# HG changeset patch # User Sushil khanchi # Date 2018-06-23 03:29:18 # Node ID e6b643ccf87d73638c754fe9ced8c6add00413e3 # Parent 36edfbac7281c731b1aed8e73555b22c2ccb96c0 rebase: make dry-run return 1 or 0 according to result In dry-run mode, if there is no conflict return 0, if any then return 1 Differential Revision: https://phab.mercurial-scm.org/D3829 diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -825,8 +825,10 @@ def rebase(ui, repo, **opts): **opts) except error.InMemoryMergeConflictsError: ui.status(_('hit a merge conflict\n')) + return 1 else: ui.status(_('there will be no conflict, you can rebase\n')) + return 0 finally: _origrebase(ui, repo, abort=True) elif inmemory: diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t +++ b/tests/test-rebase-inmemory.t @@ -287,6 +287,7 @@ Make a conflict: rollback completed hit a merge conflict rebase aborted + [1] $ hg diff $ hg status $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @@ -322,3 +323,4 @@ Check dryrun working with --collapse whe merging e hit a merge conflict rebase aborted + [1]