diff mercurial/merge.py @ 18541:5ed6a375e9ca

merge: delay debug messages for merge actions Show messages at a point where the actions have been sorted, thus preparing for backout of 760c0d67ce5e. This makes manifestmerge more of a silent operation, just like 'copies' is. Indent 'preserving' messages to make them subordinate to the action logging so they fit in the new context. (The 'preserving' messages are quite redundant and could also be removed completely.)
author Mads Kiilerich <madski@unity3d.com>
date Thu, 24 Jan 2013 23:57:44 +0100
parents 139529b0a191
children 46be5c9dac91
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Jan 24 23:57:44 2013 +0100
+++ b/mercurial/merge.py	Thu Jan 24 23:57:44 2013 +0100
@@ -176,12 +176,12 @@
     state = branchmerge and 'r' or 'f'
     for f in wctx.deleted():
         if f not in mctx:
-            actions.append((f, state, None))
+            actions.append((f, state, None, "forget deleted"))
 
     if not branchmerge:
         for f in wctx.removed():
             if f not in mctx:
-                actions.append((f, "f", None))
+                actions.append((f, "f", None, "forget removed"))
 
     return actions
 
@@ -194,8 +194,7 @@
     """
 
     def act(msg, m, f, *args):
-        repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
-        actions.append((f, m, args))
+        actions.append((f, m, args, msg))
 
     actions, copy, movewithdir = [], {}, {}
 
@@ -342,12 +341,13 @@
 
     # prescan for merges
     for a in actions:
-        f, m, args = a
+        f, m, args, msg = a
+        repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
         if m == "m": # merge
             f2, fd, move = args
             if fd == '.hgsubstate': # merged internally
                 continue
-            repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
+            repo.ui.debug("  preserving %s for resolve of %s\n" % (f, fd))
             fcl = wctx[f]
             fco = mctx[f2]
             if mctx == actx: # backwards, use working dir parent as ancestor
@@ -374,7 +374,7 @@
 
     numupdates = len(actions)
     for i, a in enumerate(actions):
-        f, m, args = a
+        f, m, args, msg = a
         repo.ui.progress(_('updating'), i + 1, item=f, total=numupdates,
                          unit=_('files'))
         if m == "r": # remove
@@ -468,7 +468,7 @@
     "record merge actions to the dirstate"
 
     for a in actions:
-        f, m, args = a
+        f, m, args, msg = a
         if m == "r": # remove
             if branchmerge:
                 repo.dirstate.remove(f)