Problem with merge after a dir rename

Long Vu long.vu at intelerad.com
Tue Jan 12 20:28:46 UTC 2016


Hi,

We are cleaning up our source tree filesystem layout and we encounter
this problem.

I've captured it in mercurial test format below, against current tip of stable.

Is this a known problem?  Is there a quick work-around to prevent
mercurial from silently randomly choosing a destination dir?

create initial repo
  $ hg init repo
  $ cd repo
  $ mkdir -p java-project/com/package
  $ echo Source > java-project/com/package/Source.java
  $ echo Test > java-project/com/package/Test.java
  $ hg ci -Am "create source test file in same folder initially"
  adding java-project/com/package/Source.java
  adding java-project/com/package/Test.java
  $ hg -q branch releasebranch
  $ hg ci -m "cut release branch"

perform refactoring on trunk
  $ hg -q up default
  $ mkdir -p java-project/source/com/package
  $ hg mv java-project/com/package/Source.java java-project/source/com/package/
  $ hg mv java-project/com java-project/test/com
  moving java-project/com/package/Test.java to
java-project/test/com/package/Test.java
  $ hg ci -Am "refactoring on trunk, proper source/ test/ layout"

create new file in release branch, merge forward and get wrong behavior
  $ hg -q up releasebranch
  $ echo Source2 > java-project/com/package/Source2.java
  $ echo Test2 > java-project/com/package/Test2.java
  $ hg ci -Am "create new source test on old branch to test merge
forward to trunk"
  adding java-project/com/package/Source2.java
  adding java-project/com/package/Test2.java
  $ hg -q up default
  $ hg merge releasebranch
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)
  $ hg diff
  abort: java-project/com/package/Source2.java@[a-f0-9]{12}: not found
in manifest! (re)
  [255]
Test2.java should have been under java-project/test/com/package/, not "source".
In fact, the destination (source/test) seems to be random as one of my re-run,
I saw it put under test.
  $ hg st
  A java-project/source/com/package/Source2.java
  A java-project/source/com/package/Test2.java

I think mercurial should prompt the user instead of silently randomly deciding
the destination.

Tested with mercurial version 3.6.3+5-bf86e3e87123.


-- 
Long Vu | Build Controller | Intelerad | +1-514-931-6222 ext. 7743

-- 

This email or any attachments may contain confidential or legally 
privileged information intended for the sole use of the addressees. Any 
use, redistribution, disclosure, or reproduction of this information, 
except as intended, is prohibited. If you received this email in error, 
please notify the sender and remove all copies of the message, including 
any attachments.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-mercurial-merge-after-dir-rename.t
Type: application/x-troff
Size: 1885 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial/attachments/20160112/050e9c1f/attachment.t>


More information about the Mercurial mailing list