# HG changeset patch # User Matt Mackall # Date 2007-12-10 16:24:14 # Node ID 0c608a8d9c5f1c8689783b61e13fd0c7bc8eb15d # Parent 2f74cfa29e8c641a127130969aaf25cbbd32f046 merge: make return codes more sensible Commands that call merge were exiting with a return code equal to the number of unresolved files. We now return 1 if there are unresolved files. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -280,13 +280,13 @@ def update(repo, node): # len(pl)==1, otherwise _merge.update() would have raised util.Abort: repo.ui.status(_(" hg update %s\n hg update %s\n") % (pl[0].rev(), repo.changectx(node).rev())) - return stats[3] + return stats[3] > 0 def clean(repo, node, show_stats=True): """forcibly switch the working directory to node, clobbering changes""" stats = _merge.update(repo, node, False, True, None) if show_stats: _showstats(repo, stats) - return stats[3] + return stats[3] > 0 def merge(repo, node, force=None, remind=True): """branch merge with node, resolving changes""" @@ -301,11 +301,11 @@ def merge(repo, node, force=None, remind % (pl[0].rev(), pl[1].rev())) elif remind: repo.ui.status(_("(branch merge, don't forget to commit)\n")) - return stats[3] + return stats[3] > 0 def revert(repo, node, choose): """revert changes to revision in node without updating dirstate""" - return _merge.update(repo, node, False, True, choose)[3] + return _merge.update(repo, node, False, True, choose)[3] > 0 def verify(repo): """verify the consistency of a repository"""