resolve: run happily after conflict-free merge
authorMartin von Zweigbergk <martinvonz@gmail.com>
Wed, 08 Oct 2014 22:30:04 -0700
changeset 23024 ec36969497de
parent 23023 63c9088bebad
child 23025 b8dd8432395d
resolve: run happily after conflict-free merge
mercurial/commands.py
tests/test-resolve.t
--- a/mercurial/commands.py	Wed Oct 08 22:16:18 2014 -0700
+++ b/mercurial/commands.py	Wed Oct 08 22:30:04 2014 -0700
@@ -5283,7 +5283,7 @@
     try:
         ms = mergemod.mergestate(repo)
 
-        if not ms.active() and not show:
+        if not (ms.active() or repo.dirstate.p2() != nullid) and not show:
             raise util.Abort(
                 _('resolve command not applicable when not merging'))
 
--- a/tests/test-resolve.t	Wed Oct 08 22:16:18 2014 -0700
+++ b/tests/test-resolve.t	Wed Oct 08 22:30:04 2014 -0700
@@ -88,16 +88,14 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
-BROKEN: resolve --all should do nothing in merge without conflicts
+resolve --all should do nothing in merge without conflicts
   $ hg resolve --all
-  abort: resolve command not applicable when not merging
-  [255]
+  (no more unresolved files)
 
-BROKEN: resolve -m should do nothing in merge without conflicts
+resolve -m should do nothing in merge without conflicts
 
   $ hg resolve -m
-  abort: resolve command not applicable when not merging
-  [255]
+  (no more unresolved files)
 
 get back to conflicting state