# HG changeset patch # User Sushil khanchi # Date 1529724558 -19800 # 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 -r 36edfbac7281 -r e6b643ccf87d hgext/rebase.py --- a/hgext/rebase.py Fri Mar 24 00:33:35 2017 -0400 +++ b/hgext/rebase.py Sat Jun 23 08:59:18 2018 +0530 @@ -825,8 +825,10 @@ **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 -r 36edfbac7281 -r e6b643ccf87d tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t Fri Mar 24 00:33:35 2017 -0400 +++ b/tests/test-rebase-inmemory.t Sat Jun 23 08:59:18 2018 +0530 @@ -287,6 +287,7 @@ 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 @@ merging e hit a merge conflict rebase aborted + [1]