# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 2015-09-14 23:25:34 # Node ID a672cc61ab1de50d931f215d89fafc22906ba356 # Parent 33af0c53aeff4b5a0483660d686cefaa06163e5a 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. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5025,8 +5025,7 @@ def phase(ui, repo, *revs, **opts): 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 @@ def phase(ui, repo, *revs, **opts): ui.note(msg) else: ui.warn(_('no phases changed\n')) - ret = 1 return ret def postincoming(ui, repo, modheads, optupdate, checkout): diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -322,7 +322,6 @@ check that local configs for the cached ... 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)