[PATCH V2] checkcopies: don't lose origin of file during merge (issue4748)

Jeremy Parente jeremy.parente at oneaccess-net.com
Thu Jul 16 03:33:00 CDT 2015


# HG changeset patch
# User Jeremy Parente <jeremy.parente at oneaccess-net.com>
# Date 1437035066 -7200
#      Thu Jul 16 10:24:26 2015 +0200
# Branch stable
# Node ID abd4cab8a1bac17d149ec44c36e9f556670c14b1
# Parent  540cd0ddac49c1125b2e013aa2ff18ecbd4dd954
checkcopies: don't lose origin of file during merge (issue4748)

Previously in checkcopies loop, when the "of" file in m2 is the same than the
one in common ancestor, we exit from the loop. So at the end of the function
we have a "of" file that exists in the common ancestor and "f" is considered
as a divergent file and not as a copy.

Since file is a copy, we now add it to the "copy" dictionnary, so we don't
lose the origin and can perform diff with "old" revision where the file is not
renamed.

File must not be considerd as a divergent file after the loop, since we know
it has been copied from the common ancestor and has not changed in m2.

diff -r 540cd0ddac49 -r abd4cab8a1ba mercurial/copies.py
--- a/mercurial/copies.py	Mon Jun 29 19:09:42 2015 -0700
+++ b/mercurial/copies.py	Thu Jul 16 10:24:26 2015 +0200
@@ -491,8 +491,15 @@
         fullcopy[f] = of # remember for dir rename detection
         if of not in m2:
             continue # no match, keep looking
+
         if m2[of] == ma.get(of):
-            break # no merge needed, quit early
+            # fix issue4748; origin of a renamed file may be lost after a
+            # merge when the origin file is not modified in m2, before fix we
+            # only do the break, and so the "if of in ma" at end of the
+            # function leads to add file to the diverge list
+            copy[f] = of
+            of = None
+            break
         c2 = ctx(of, m2[of])
         cr = _related(oc, c2, ca.rev())
         if cr and (of == f or of == c2.path()): # non-divergent
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-commit-amend.t
--- a/tests/test-commit-amend.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-commit-amend.t	Thu Jul 16 10:24:26 2015 +0200
@@ -633,7 +633,7 @@
   (no more unresolved files)
   $ hg ci -m 'merge bar'
   $ hg log --config diff.git=1 -pr .
-  changeset:   23:93cd4445f720
+  changeset:   23:00530ee041cb
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -666,7 +666,7 @@
   $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
   HGEDITFORM=commit.amend.merge
   $ hg log --config diff.git=1 -pr .
-  changeset:   24:832b50f2c271
+  changeset:   24:95901dec8caf
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -699,7 +699,7 @@
   $ hg mv zz z
   $ hg ci --amend -m 'merge bar (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   26:bdafc5c72f74
+  changeset:   26:b26049e2280c
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -735,9 +735,9 @@
   $ echo aa >> aaa
   $ hg ci -m 'merge bar again'
   $ hg log --config diff.git=1 -pr .
-  changeset:   28:32f19415b634
+  changeset:   28:043883f1ee2e
   tag:         tip
-  parent:      26:bdafc5c72f74
+  parent:      26:b26049e2280c
   parent:      27:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -770,9 +770,9 @@
   $ hg mv aaa aa
   $ hg ci --amend -m 'merge bar again (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   30:1e2a06b3d312
+  changeset:   30:a3ac3d1ec482
   tag:         tip
-  parent:      26:bdafc5c72f74
+  parent:      26:b26049e2280c
   parent:      27:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -810,9 +810,9 @@
   use (c)hanged version or (d)elete? c
   $ hg ci -m 'merge bar (with conflicts)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   33:97a298b0c59f
+  changeset:   33:4fd48f6e2dfe
   tag:         tip
-  parent:      32:3d78ce4226b8
+  parent:      32:874800cc4ebf
   parent:      31:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -822,9 +822,9 @@
   $ hg rm aa
   $ hg ci --amend -m 'merge bar (with conflicts, amended)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   35:6de0c1bde1c8
+  changeset:   35:14ad99f27692
   tag:         tip
-  parent:      32:3d78ce4226b8
+  parent:      32:874800cc4ebf
   parent:      31:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -922,7 +922,7 @@
   HG: M: 
   HG: A: foo
   HG: R: 
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 14ad99f27692 foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -936,12 +936,12 @@
   HG: M: 
   HG: A: foo y
   HG: R: 
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 14ad99f27692 foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 14ad99f27692 y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -954,18 +954,18 @@
   HG: M: 
   HG: A: foo y
   HG: R: a
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 14ad99f27692 a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 14ad99f27692 foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 14ad99f27692 y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -978,23 +978,23 @@
   HG: M: 
   HG: A: foo y
   HG: R: a x
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 14ad99f27692 a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 14ad99f27692 foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 x
+  HG: diff -r 14ad99f27692 x
   HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,1 +0,0 @@
   HG: -x
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 14ad99f27692 y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -1009,23 +1009,23 @@
   HG: M: 
   HG: A: foo y
   HG: R: a x
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 14ad99f27692 a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 14ad99f27692 foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 x
+  HG: diff -r 14ad99f27692 x
   HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,1 +0,0 @@
   HG: -x
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 14ad99f27692 y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -1122,15 +1122,17 @@
   1 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ # create newdirname/newfile.py
   $ hg merge default
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg ci -m add
   $ 
   $ hg debugrename newdirname/newfile.py
   newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob)
   $ hg status -C --change .
+  M newdirname/commonfile.py
   A newdirname/newfile.py
   $ hg status -C --rev 1
+  M newdirname/commonfile.py
   A newdirname/newfile.py
   $ hg status -C --rev 2
   A newdirname/commonfile.py
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-commit-interactive.t	Thu Jul 16 10:24:26 2015 +0200
@@ -1104,15 +1104,20 @@
   6 files updated, 0 files merged, 2 files removed, 0 files unresolved
 
   $ hg merge thatbranch
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  merging top.bundle and tip.bundle to top.bundle
+  warning: $TESTTMP/a/top.bundle looks like a binary file.
+  merging top.bundle incomplete! (edit conflicts, then use 'hg resolve --mark')
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ hg revert -r default top.bundle
 
   $ hg commit -i -m'will abort'
   abort: cannot partially commit a merge (use "hg commit" instead)
   [255]
 
   $ hg up -C
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
 Editing patch (and ignoring trailing text)
 
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-convert-hg-startrev.t
--- a/tests/test-convert-hg-startrev.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-convert-hg-startrev.t	Thu Jul 16 10:24:26 2015 +0200
@@ -30,7 +30,7 @@
   $ hg ci -d '3 0' -qAm '3: change a'
   $ hg merge
   merging a and e to e
-  3 files updated, 1 files merged, 1 files removed, 0 files unresolved
+  3 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg ci -d '4 0' -qAm '4: merge 2 and 3'
   $ echo a >> a
@@ -54,7 +54,7 @@
   $ glog full
   o  5 "5: change a" files: a
   |
-  o    4 "4: merge 2 and 3" files: e f
+  o    4 "4: merge 2 and 3" files: d e f
   |\
   | o  3 "3: change a" files: a
   | |
@@ -83,7 +83,7 @@
   $ glog full
   o  5 "5: change a" files: a
   |
-  o    4 "4: merge 2 and 3" files: e f
+  o    4 "4: merge 2 and 3" files: d e f
   |\
   | o  3 "3: change a" files: a
   | |
@@ -130,7 +130,7 @@
 (It seems like a bug in log that the following doesn't show rev 1.)
 
   $ hg log --follow --copies e
-  changeset:   2:82bbac3d2cf4
+  changeset:   2:54402235e79a
   user:        test
   date:        Thu Jan 01 00:00:04 1970 +0000
   summary:     4: merge 2 and 3
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-issue672.t
--- a/tests/test-issue672.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-issue672.t	Thu Jul 16 10:24:26 2015 +0200
@@ -29,19 +29,17 @@
     unmatched files in other:
      1a
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: '1' -> dst: '1a' 
+     src: '1' -> dst: '1a' *
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 81f4b099af3d, local: c64f439569a9+, remote: c12dcd37c90a
-   1: other deleted -> r
+   preserving 1 for resolve of 1a
   removing 1
-  updating: 1 1/2 files (50.00%)
-   1a: remote created -> g
-  getting 1a
-  updating: 1a 2/2 files (100.00%)
    2: remote unchanged -> k
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+   1a: remote moved from 1 -> m
+  updating: 1a 1/1 files (100.00%)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ hg ci -m merge1 # 3
@@ -65,13 +63,13 @@
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
-   ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
+   ancestor: c64f439569a9, local: 7aff4c906f45+, remote: 746e9549ea96
    preserving 1a for resolve of 1a
    1a: local copied/moved from 1 -> m
   updating: 1a 1/1 files (100.00%)
   picked tool 'internal:merge' for 1a (binary False symlink False)
   merging 1a and 1 to 1a
-  my 1a at e327dca35ac8+ other 1 at 746e9549ea96 ancestor 1 at 81f4b099af3d
+  my 1a at 7aff4c906f45+ other 1 at 746e9549ea96 ancestor 1 at 81f4b099af3d
    premerge successful
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -88,14 +86,14 @@
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
-   ancestor: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
+   ancestor: c64f439569a9, local: 746e9549ea96+, remote: 7aff4c906f45
    preserving 1 for resolve of 1a
   removing 1
    1a: remote moved from 1 -> m
   updating: 1a 1/1 files (100.00%)
   picked tool 'internal:merge' for 1a (binary False symlink False)
   merging 1 and 1a to 1a
-  my 1a at 746e9549ea96+ other 1a at e327dca35ac8 ancestor 1 at 81f4b099af3d
+  my 1a at 746e9549ea96+ other 1a at 7aff4c906f45 ancestor 1 at 81f4b099af3d
    premerge successful
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-merge-local.t
--- a/tests/test-merge-local.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-merge-local.t	Thu Jul 16 10:24:26 2015 +0200
@@ -55,7 +55,7 @@
   merging zzz1_merge_ok
   merging zzz2_merge_bad
   merging zzz2_merge_bad failed!
-  3 files updated, 1 files merged, 2 files removed, 1 files unresolved
+  3 files updated, 1 files merged, 1 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
   [1]
 
@@ -89,7 +89,7 @@
   merging zzz2_merge_bad
   warning: conflicts during merge.
   merging zzz2_merge_bad incomplete! (edit conflicts, then use 'hg resolve --mark')
-  3 files updated, 1 files merged, 2 files removed, 1 files unresolved
+  3 files updated, 1 files merged, 1 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
   [1]
 
@@ -125,7 +125,7 @@
 
   $ hg co
   merging zzz1_merge_ok
-  4 files updated, 1 files merged, 2 files removed, 0 files unresolved
+  4 files updated, 1 files merged, 1 files removed, 0 files unresolved
 
   $ hg diff --nodates | grep "^[+-][^<>]"
   --- a/zzz1_merge_ok
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-rebase-rename.t
--- a/tests/test-rebase-rename.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-rebase-rename.t	Thu Jul 16 10:24:26 2015 +0200
@@ -285,8 +285,11 @@
 Rebase the copies on top of the unrelated change.
   $ hg rebase --source 1 --dest 4
   rebasing 1:79d255d24ad2 "File b created as copy of a and modified"
+  merging a and b to b
   rebasing 2:327f772bc074 "File c created as copy of b and modified"
+  merging b and c to c
   rebasing 3:421b7e82bb85 "File d created as copy of c and modified"
+  merging c and d to d
   saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-a2265555-backup.hg (glob)
   $ hg update 4
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -310,6 +313,7 @@
   created new head
   $ hg rebase -s 2 --dest 5 --collapse
   rebasing 2:68bf06433839 "File b created as copy of a and modified"
+  merging a and b to b
   note: rebase of 2:68bf06433839 created no changes to commit
   rebasing 3:af74b229bc02 "File c created as copy of b and modified"
   merging b and c to c
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-rename-dir-merge.t
--- a/tests/test-rename-dir-merge.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-rename-dir-merge.t	Thu Jul 16 10:24:26 2015 +0200
@@ -31,35 +31,35 @@
      b/a
      b/b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a/a' -> dst: 'b/a' 
-     src: 'a/b' -> dst: 'b/b' 
+     src: 'a/a' -> dst: 'b/a' *
+     src: 'a/b' -> dst: 'b/b' *
     checking for directory renames
      discovered dir src: 'a/' -> dst: 'b/'
      pending file src: 'a/c' -> dst: 'b/c'
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
-   a/a: other deleted -> r
+   preserving a/a for resolve of b/a
+   preserving a/b for resolve of b/b
   removing a/a
-   a/b: other deleted -> r
   removing a/b
-  updating: a/b 2/5 files (40.00%)
-   b/a: remote created -> g
-  getting b/a
-   b/b: remote created -> g
-  getting b/b
-  updating: b/b 4/5 files (80.00%)
+   b/a: remote moved from a/a -> m
+  updating: b/a 1/3 files (33.33%)
+   b/b: remote moved from a/b -> m
+  updating: b/b 2/3 files (66.67%)
    b/c: remote directory rename - move from a/c -> dm
-  updating: b/c 5/5 files (100.00%)
+  updating: b/c 3/3 files (100.00%)
   moving a/c to b/c (glob)
-  3 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ echo a/* b/*
   a/d b/a b/b b/c
   $ hg st -C
   M b/a
+    a/a
   M b/b
+    a/b
   A b/c
     a/c
   R a/a
@@ -71,7 +71,7 @@
   b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
 
   $ hg co -C 1
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg merge --debug 2
     searching for copies back to rev 1
     unmatched files in local:
@@ -80,23 +80,33 @@
     unmatched files in other:
      a/c
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a/a' -> dst: 'b/a' 
-     src: 'a/b' -> dst: 'b/b' 
+     src: 'a/a' -> dst: 'b/a' *
+     src: 'a/b' -> dst: 'b/b' *
     checking for directory renames
      discovered dir src: 'a/' -> dst: 'b/'
      pending file src: 'a/c' -> dst: 'b/c'
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
+   preserving b/a for resolve of b/a
+   preserving b/b for resolve of b/b
+   b/a: local copied/moved from a/a -> m
+  updating: b/a 1/3 files (33.33%)
+   b/b: local copied/moved from a/b -> m
+  updating: b/b 2/3 files (66.67%)
    b/c: local directory rename - get from a/c -> dg
-  updating: b/c 1/1 files (100.00%)
+  updating: b/c 3/3 files (100.00%)
   getting a/c to b/c
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ echo a/* b/*
   a/d b/a b/b b/c
   $ hg st -C
+  M b/a
+    a/a
+  M b/b
+    a/b
   A b/c
     a/c
   ? a/d
@@ -119,9 +129,13 @@
 but it should succeed if the content matches
   $ hg cat -r 2 a/c > b/c
   $ hg merge 2
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg st -C
+  M b/a
+    a/a
+  M b/b
+    a/b
   A b/c
     a/c
   ? a/d
@@ -137,16 +151,18 @@
   merging b/c and a/c to b/c
   warning: conflicts during merge.
   merging b/c incomplete! (edit conflicts, then use 'hg resolve --mark')
-  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
   $ hg st -A
+  M b/a
+    a/a
+  M b/b
+    a/b
   M b/c
     a/c
   ? a/d
   ? b/c.orig
-  C b/a
-  C b/b
   $ cat b/c
   <<<<<<< local: f1c50ca4f127 - test: new file in target directory
   target
@@ -168,12 +184,14 @@
   merging a/c and b/c to b/c
   warning: conflicts during merge.
   merging b/c incomplete! (edit conflicts, then use 'hg resolve --mark')
-  2 files updated, 0 files merged, 2 files removed, 1 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
   $ hg st -A
   M b/a
+    a/a
   M b/b
+    a/b
   M b/c
     a/c
   R a/a
@@ -226,11 +244,13 @@
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
   $ hg merge
-  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  merging a/f and b/f to b/f
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ hg st -C
   M b/f
+    a/f
   A b/aa/g
     a/aa/g
   R a/aa/g
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-rename-merge2.t	Thu Jul 16 10:24:26 2015 +0200
@@ -232,14 +232,14 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a' -> dst: 'b' 
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
+   preserving a for resolve of b
    preserving rev for resolve of rev
-   b: remote created -> g
-  getting b
+   b: remote copied from a -> m
   updating: b 1/2 files (50.00%)
    rev: versions differ -> m
   updating: rev 2/2 files (100.00%)
@@ -252,6 +252,7 @@
   (branch merge, don't forget to commit)
   --------------
   M b
+    a
   C a
   --------------
   
@@ -264,24 +265,28 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a' -> dst: 'b' 
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
+   preserving b for resolve of b
    preserving rev for resolve of rev
+   b: local copied/moved from a -> m
+  updating: b 1/2 files (50.00%)
    rev: versions differ -> m
-  updating: rev 1/1 files (100.00%)
+  updating: rev 2/2 files (100.00%)
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev at 86a2aa42fc76+ other rev at 97c705ade336 ancestor rev at 924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
-  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   --------------
+  M b
+    a
   C a
-  C b
   --------------
   
   $ tm "      " "nm a b" "      " "7  get b"
@@ -293,29 +298,28 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a' -> dst: 'b' 
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
+   preserving a for resolve of b
    preserving rev for resolve of rev
-   a: other deleted -> r
   removing a
-  updating: a 1/3 files (33.33%)
-   b: remote created -> g
-  getting b
-  updating: b 2/3 files (66.67%)
+   b: remote moved from a -> m
+  updating: b 1/2 files (50.00%)
    rev: versions differ -> m
-  updating: rev 3/3 files (100.00%)
+  updating: rev 2/2 files (100.00%)
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev at 94b33a1b7f2d+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
-  1 files updated, 1 files merged, 1 files removed, 0 files unresolved
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   --------------
   M b
+    a
   --------------
   
   $ tm "nm a b" "      " "      " "8  nothing"
@@ -327,23 +331,27 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     src: 'a' -> dst: 'b' 
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
+   preserving b for resolve of b
    preserving rev for resolve of rev
+   b: local copied/moved from a -> m
+  updating: b 1/2 files (50.00%)
    rev: versions differ -> m
-  updating: rev 1/1 files (100.00%)
+  updating: rev 2/2 files (100.00%)
   picked tool 'python ../merge' for rev (binary False symlink False)
   merging rev
   my rev at 02963e448370+ other rev at 97c705ade336 ancestor rev at 924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
-  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   --------------
-  C b
+  M b
+    a
   --------------
   
   $ tm "um a b" "um a b" "      " "9  do merge with ancestor in a"
diff -r 540cd0ddac49 -r abd4cab8a1ba tests/test-revert.t
--- a/tests/test-revert.t	Mon Jun 29 19:09:42 2015 -0700
+++ b/tests/test-revert.t	Thu Jul 16 10:24:26 2015 +0200
@@ -350,7 +350,7 @@
 merge it with the other head
 
   $ hg merge # merge 1 into 2
-  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg summary
   parent: 2:b8ec310b2d4e tip
@@ -358,7 +358,7 @@
   parent: 1:f6180deb8fbe 
    rename
   branch: default
-  commit: 2 modified, 1 removed (merge)
+  commit: 2 modified, 1 renamed, 1 copied (merge)
   update: (current)
 
 clarifies who added what
@@ -412,7 +412,6 @@
   $ hg status
   M base
   R allyour
-  R ignored
   R newadd
 
 Systematic behavior validation of most possible cases


More information about the Mercurial-devel mailing list