comparison hgext/rebase.py @ 38546:731debab233f

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
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 29 Jun 2018 01:35:09 +0530
parents cf24f678adda
children a06b2b032557
comparison
equal deleted inserted replaced
38545:85e3aa21bcdc 38546:731debab233f
842 else: 842 else:
843 return _dorebase(ui, repo, opts) 843 return _dorebase(ui, repo, opts)
844 844
845 def _dryrunrebase(ui, repo, opts): 845 def _dryrunrebase(ui, repo, opts):
846 rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts) 846 rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
847 ui.status(_('starting dry-run rebase; repository will not be changed\n'))
847 with repo.wlock(), repo.lock(): 848 with repo.wlock(), repo.lock():
848 try: 849 try:
849 overrides = {('rebase', 'singletransaction'): True} 850 overrides = {('rebase', 'singletransaction'): True}
850 with ui.configoverride(overrides, 'rebase'): 851 with ui.configoverride(overrides, 'rebase'):
851 _origrebase(ui, repo, opts, rbsrt, inmemory=True, 852 _origrebase(ui, repo, opts, rbsrt, inmemory=True,
852 leaveunfinished=True) 853 leaveunfinished=True)
853 except error.InMemoryMergeConflictsError: 854 except error.InMemoryMergeConflictsError:
854 ui.status(_('hit a merge conflict\n')) 855 ui.status(_('hit a merge conflict\n'))
855 return 1 856 return 1
856 else: 857 else:
857 ui.status(_('there will be no conflict, you can rebase\n')) 858 ui.status(_('dry-run rebase completed successfully; run without '
859 '-n/--dry-run to perform this rebase\n'))
858 return 0 860 return 0
859 finally: 861 finally:
860 # no need to store backup in case of dryrun 862 # no need to store backup in case of dryrun
861 rbsrt._prepareabortorcontinue(isabort=True, backup=False, 863 rbsrt._prepareabortorcontinue(isabort=True, backup=False,
862 suppwarns=True) 864 suppwarns=True)