Patchwork [2,of,7] merge: move dr/rd warning messages out of applyupdates()

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 10, 2014, 9:09 p.m.
Message ID <09a16fbb2ac3cc1a66ea.1418245740@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7043/
State Accepted
Commit 5126d7718d7c79270233b85fc99668f37eeb57d2
Headers show

Comments

Martin von Zweigbergk - Dec. 10, 2014, 9:09 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1418163511 28800
#      Tue Dec 09 14:18:31 2014 -0800
# Node ID 09a16fbb2ac3cc1a66eadc6241f74f92553f59af
# Parent  53e54ae19ff275421e4103724a28ac2773e5f952
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.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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)