changeset 26957:d16d73173fdd

merge: move messages about possible conflicts a litte earlier I actually wanted to reduce the amount of code around the call to applyupdates(), so I tried moving these warnings a little earlier, and I think it makes the output make a little more sense (see changes to test cases).
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Nov 2015 13:14:03 -0800
parents 4b56214ebb7a
children 32bd195ab787
files mercurial/merge.py tests/test-rename-merge1.t tests/test-rename-merge2.t
diffstat 3 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Sun Nov 01 15:46:06 2015 +0900
+++ b/mercurial/merge.py	Thu Nov 12 13:14:03 2015 -0800
@@ -1273,16 +1273,6 @@
                 actions['g'].append((f, (flags,), "prompt recreating"))
         del actions['dc'][:]
 
-        ### apply phase
-        if not branchmerge: # just jump to the new rev
-            fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
-        if not partial:
-            repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
-            # note that we're in the middle of an update
-            repo.vfs.write('updatestate', p2.hex())
-
-        stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
-
         # divergent renames
         for f, fl in sorted(diverge.iteritems()):
             repo.ui.warn(_("note: possible conflict - %s was renamed "
@@ -1297,6 +1287,16 @@
             for nf in fl:
                 repo.ui.warn(" %s\n" % nf)
 
+        ### apply phase
+        if not branchmerge: # just jump to the new rev
+            fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
+        if not partial:
+            repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
+            # note that we're in the middle of an update
+            repo.vfs.write('updatestate', p2.hex())
+
+        stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
+
         if not partial:
             repo.dirstate.beginparentchange()
             repo.setparents(fp1, fp2)
--- a/tests/test-rename-merge1.t	Sun Nov 01 15:46:06 2015 +0900
+++ b/tests/test-rename-merge1.t	Thu Nov 12 13:14:03 2015 -0800
@@ -36,6 +36,9 @@
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
+  note: possible conflict - a2 was renamed multiple times to:
+   c2
+   b2
    preserving a for resolve of b
   removing a
    b2: remote created -> g
@@ -45,9 +48,6 @@
   merging a and b to b
   my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
    premerge successful
-  note: possible conflict - a2 was renamed multiple times to:
-   c2
-   b2
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
@@ -177,10 +177,10 @@
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
+  note: possible conflict - file was deleted and renamed to:
+   newfile
    newfile: remote created -> g
   getting newfile
-  note: possible conflict - file was deleted and renamed to:
-   newfile
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg status
--- a/tests/test-rename-merge2.t	Sun Nov 01 15:46:06 2015 +0900
+++ b/tests/test-rename-merge2.t	Thu Nov 12 13:14:03 2015 -0800
@@ -411,6 +411,9 @@
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
+  note: possible conflict - a was renamed multiple times to:
+   b
+   c
    preserving rev for resolve of rev
    c: remote created -> g
   getting c
@@ -423,9 +426,6 @@
   my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
   launching merge tool: python ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
-  note: possible conflict - a was renamed multiple times to:
-   b
-   c
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   --------------