[PATCH 3 of 5] summary: move mergemod before parents to give access to ms

timeless timeless at mozdev.org
Tue Mar 22 18:21:50 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1458226229 0
#      Thu Mar 17 14:50:29 2016 +0000
# Node ID e17caa0aae2559b41c0016c6a432029c2da5c9c2
# Parent  0ff0274cf3ca9d66dd86d0f9431a06bc2ba11535
summary: move mergemod before parents to give access to ms

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6573,6 +6573,17 @@
     pnode = parents[0].node()
     marks = []
 
+    ms = None
+    try:
+        ms = mergemod.mergestate.read(repo)
+    except error.UnsupportedMergeRecords as e:
+        s = ' '.join(e.recordtypes)
+        ui.warn(
+            _('warning: merge state has unsupported record types: %s\n') % s)
+        unresolved = 0
+    else:
+        unresolved = [f for f in ms if ms[f] == 'u']
+
     for p in parents:
         # label with log.changeset (instead of log.parent) since this
         # shows a working directory parent *changeset*:
@@ -6628,16 +6639,6 @@
         if d in status.added:
             status.added.remove(d)
 
-    try:
-        ms = mergemod.mergestate.read(repo)
-    except error.UnsupportedMergeRecords as e:
-        s = ' '.join(e.recordtypes)
-        ui.warn(
-            _('warning: merge state has unsupported record types: %s\n') % s)
-        unresolved = 0
-    else:
-        unresolved = [f for f in ms if ms[f] == 'u']
-
     subs = [s for s in ctx.substate if ctx.sub(s).dirty()]
 
     labels = [(ui.label(_('%d modified'), 'status.modified'), status.modified),
diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -332,12 +332,12 @@
   (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
   [255]
   $ hg summary
+  warning: merge state has unsupported record types: X
   parent: 2:57653b9f834a 
    append baz to files
   parent: 1:dc77451844e3 
    append bar to files
   branch: default
-  warning: merge state has unsupported record types: X
   commit: 2 modified, 2 unknown (merge)
   update: 2 new changesets (update)
   phases: 5 draft


More information about the Mercurial-devel mailing list