changeset 26366:a672cc61ab1d

phases: return zero for no-op operations (issue4751) (BC) It is rather unhelpful to return 1 if there were no changes because the request matches the current state of phases. So we just undo that.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 14 Sep 2015 19:25:34 -0400
parents 33af0c53aeff
children 0224d22ef5d8
files mercurial/commands.py tests/test-commandserver.t
diffstat 2 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Sep 24 14:45:17 2015 -0400
+++ b/mercurial/commands.py	Mon Sep 14 19:25:34 2015 -0400
@@ -5025,8 +5025,7 @@
 
         public < draft < secret
 
-    Returns 0 on success, 1 if no phases were changed or some could not
-    be changed.
+    Returns 0 on success, 1 if some phases could not be changed.
 
     (For more information about the phases concept, see :hg:`help phases`.)
     """
@@ -5095,7 +5094,6 @@
                 ui.note(msg)
         else:
             ui.warn(_('no phases changed\n'))
-            ret = 1
     return ret
 
 def postincoming(ui, repo, modheads, optupdate, checkout):
--- a/tests/test-commandserver.t	Thu Sep 24 14:45:17 2015 -0400
+++ b/tests/test-commandserver.t	Mon Sep 14 19:25:34 2015 -0400
@@ -322,7 +322,6 @@
   ...     runcommand(server, ['phase', '-r', '.'])
   *** runcommand phase -r . -p
   no phases changed
-   [1]
   *** runcommand commit -Am.
   *** runcommand rollback
   repository tip rolled back to revision 3 (undo commit)