Page MenuHomePhabricator

Using `arc patch` on a revision with dependency leaves bookmark on the applied commit
Open, Needs TriagePublic

Description

Steps for Reproduction
  • I set up example revisions on rHGTEST at D18122 (parent) and D18123 (child)
  1. Create revision D1 and then create a revision on top of that D2
  2. Update D2 to be listed as dependent on D1
  3. Remove the commits locally using prune/strip
  4. Run arc patch D2

Result: The arcpatch-D2 bookmark remains on the changeset that the chain of commits is applied to. The bookmark should be on the commit applied for the revision just patched.

cspeckrun@specktop ~/P/p/hg-test> arc patch D18123
Created and checked out bookmark arcpatch-D18123.
Updating to the revision's base commit
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark arcpatch-D18123)
Created and checked out bookmark arcpatch-D18122.
 OKAY  Successfully committed patch.


    This diff is against commit 71825acef11baf254603bfc8b4b692bc961624b7, but
    the commit is nowhere in the working copy. Try to apply it against the
    current working copy state? (.) [Y/n] y

 OKAY  Successfully committed patch.
cspeckrun@specktop ~/P/p/hg-test> hg wip
@   23:52b70aa857c2 cspeck (2 seconds ago) tip
|     Child revision
o   22:c5421705ed9e cspeck (5 seconds ago)
|     Parent revision
o   12:c395aaac58f5 cspeck (3 months ago) arcpatch-D18123 master
|     MAINT: delivering macros
~

Using Mercurial 4.2.1 on client.

Event Timeline

This just looks unambiguously wrong to me.

(That is, our behavior seems clearly incorrect.)

Also, I've noticed that when applying dependent revisions like this, it seems that usually all of the commits will apply cleanly (without prompting) except for the last one, which will always fail to locate the commit to apply on and prompt whether to apply to current working copy state. Based on what I think arcanist is doing I would expect all patches to prompt whether to apply to working copy (since all patches will be given new commit IDs) -- it seems strange that all will apply cleanly except the last one. Does that sound like a bug or am I misunderstanding what's happening? I can try to investigate/debug if you think it might be a bug.

That sounds like a bug, but my guess is that the investigation would probably turn up "wow you are dumb at writing software" in about 3 minutes and not really get us much closer to a fix, which is probably "rewrite arc patch to fix 200 problems".