summary: move mergemod before parents to give access to ms
authortimeless <timeless@mozdev.org>
Thu, 17 Mar 2016 14:50:29 +0000
changeset 28641 4acd5651ffa2
parent 28640 4fc640fd0026
child 28642 cfbae6c8ad5a
summary: move mergemod before parents to give access to ms
mercurial/commands.py
tests/test-resolve.t
--- a/mercurial/commands.py	Thu Mar 17 00:36:01 2016 +0000
+++ b/mercurial/commands.py	Thu Mar 17 14:50:29 2016 +0000
@@ -6583,6 +6583,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*:
@@ -6638,16 +6649,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),
--- a/tests/test-resolve.t	Thu Mar 17 00:36:01 2016 +0000
+++ b/tests/test-resolve.t	Thu Mar 17 14:50:29 2016 +0000
@@ -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