resolve: don't abort resolve -l even when no merge is in progress
authorSiddharth Agarwal <sid0@fb.com>
Fri, 23 May 2014 13:10:31 -0700
changeset 21541 6062593d8b06
parent 21539 0c4077905932
child 21545 43eecb4e23f8
resolve: don't abort resolve -l even when no merge is in progress This broke some internal automation that was quite reasonably checking for unresolved files as a way to determine whether a merge happened cleanly. We still abort for resolve --mark etc.
mercurial/commands.py
tests/test-histedit-non-commute-abort.t
tests/test-resolve.t
tests/test-shelve.t
--- a/mercurial/commands.py	Sun May 25 13:47:42 2014 +0200
+++ b/mercurial/commands.py	Fri May 23 13:10:31 2014 -0700
@@ -4922,7 +4922,7 @@
 
     ms = mergemod.mergestate(repo)
 
-    if not ms.active():
+    if not ms.active() and not show:
         raise util.Abort(_('resolve command not applicable when not merging'))
 
     m = scmutil.match(repo[None], pats, opts)
--- a/tests/test-histedit-non-commute-abort.t	Sun May 25 13:47:42 2014 +0200
+++ b/tests/test-histedit-non-commute-abort.t	Fri May 23 13:10:31 2014 -0700
@@ -85,8 +85,6 @@
 
 log after abort
   $ hg resolve -l
-  abort: resolve command not applicable when not merging
-  [255]
   $ hg log --graph
   @  changeset:   6:bfa474341cc9
   |  tag:         tip
--- a/tests/test-resolve.t	Sun May 25 13:47:42 2014 +0200
+++ b/tests/test-resolve.t	Fri May 23 13:10:31 2014 -0700
@@ -42,9 +42,12 @@
   no more unresolved files
   $ hg commit -m 'resolved'
 
-resolve -l should error since no merge in progress
+resolve -l should be empty
 
   $ hg resolve -l
+
+resolve -m should abort since no merge in progress
+  $ hg resolve -m
   abort: resolve command not applicable when not merging
   [255]
 
--- a/tests/test-shelve.t	Sun May 25 13:47:42 2014 +0200
+++ b/tests/test-shelve.t	Fri May 23 13:10:31 2014 -0700
@@ -262,8 +262,6 @@
   summary:     second
   
   $ hg resolve -l
-  abort: resolve command not applicable when not merging
-  [255]
   $ hg status
   A foo/foo
   ? a/a.orig