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
--- 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:
--- 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]