# HG changeset patch # User Sushil khanchi # Date 2018-06-28 20:05:09 # Node ID 731debab233fd8e4c677cb15f479ee9385f530c0 # Parent 85e3aa21bcdc8461b9355ba571d03b1d25756e0b rebase: improve output of --dry-run Improved output when in dryrun, for user to make sure that no change will be written to repository. Differential Revision: https://phab.mercurial-scm.org/D3764 diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -844,6 +844,7 @@ def rebase(ui, repo, **opts): def _dryrunrebase(ui, repo, opts): rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts) + ui.status(_('starting dry-run rebase; repository will not be changed\n')) with repo.wlock(), repo.lock(): try: overrides = {('rebase', 'singletransaction'): True} @@ -854,7 +855,8 @@ def _dryrunrebase(ui, repo, opts): ui.status(_('hit a merge conflict\n')) return 1 else: - ui.status(_('there will be no conflict, you can rebase\n')) + ui.status(_('dry-run rebase completed successfully; run without ' + '-n/--dry-run to perform this rebase\n')) return 0 finally: # no need to store backup in case of dryrun 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 @@ -208,10 +208,11 @@ Make sure it throws error while passing Check dryrun gives correct results when there is no conflict in rebasing $ hg rebase -s 2 -d 6 -n + starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" - there will be no conflict, you can rebase + dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase $ hg diff $ hg status @@ -240,10 +241,11 @@ Check dryrun gives correct results when Check dryrun working with --collapse when there is no conflict $ hg rebase -s 2 -d 6 -n --collapse + starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" - there will be no conflict, you can rebase + dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase Check dryrun gives correct results when there is conflict in rebasing Make a conflict: @@ -276,6 +278,7 @@ Make a conflict: a $ hg rebase -s 2 -d 7 -n + starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" @@ -313,6 +316,7 @@ Make a conflict: Check dryrun working with --collapse when there is conflicts $ hg rebase -s 2 -d 7 -n --collapse + starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e"