merge: move dr/rd warning messages out of applyupdates()
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 09 Dec 2014 14:18:31 -0800
changeset 23525 5126d7718d7c
parent 23524 a1a7c94def6d
child 23526 a5887f2da5e6
merge: move dr/rd warning messages out of applyupdates() As preparation for making 'dr' and 'rd' actions no longer actions, move the reporting from applyupdates() to its caller update(). This way we won't have to pass additonal arguments to applyupdates() when they are no longer actions. Also, the warnings are equally unrelated to applyupdates() as they are to recordupdates(), as they don't result in any changes to either the working copy or the dirstate. See earlier patch for additional motivation.
mercurial/merge.py
--- a/mercurial/merge.py	Fri Dec 05 16:13:26 2014 -0800
+++ b/mercurial/merge.py	Tue Dec 09 14:18:31 2014 -0800
@@ -824,22 +824,6 @@
         repo.wwrite(f, mctx.filectx(f0).data(), flags)
         updated += 1
 
-    # divergent renames
-    for f, args, msg in actions['dr']:
-        fl, = args
-        repo.ui.warn(_("note: possible conflict - %s was renamed "
-                       "multiple times to:\n") % f)
-        for nf in fl:
-            repo.ui.warn(" %s\n" % nf)
-
-    # rename and delete
-    for f, args, msg in actions['rd']:
-        fl, = args
-        repo.ui.warn(_("note: possible conflict - %s was deleted "
-                       "and renamed to:\n") % f)
-        for nf in fl:
-            repo.ui.warn(" %s\n" % nf)
-
     # exec
     for f, args, msg in actions['e']:
         repo.ui.debug(" %s: %s -> e\n" % (f, msg))
@@ -1116,6 +1100,22 @@
 
         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
 
+        # divergent renames
+        for f, args, msg in actions['dr']:
+            fl, = args
+            repo.ui.warn(_("note: possible conflict - %s was renamed "
+                           "multiple times to:\n") % f)
+            for nf in fl:
+                repo.ui.warn(" %s\n" % nf)
+
+        # rename and delete
+        for f, args, msg in actions['rd']:
+            fl, = args
+            repo.ui.warn(_("note: possible conflict - %s was deleted "
+                           "and renamed to:\n") % f)
+            for nf in fl:
+                repo.ui.warn(" %s\n" % nf)
+
         if not partial:
             repo.dirstate.beginparentchange()
             repo.setparents(fp1, fp2)