Mercurial > public > mercurial-scm > hg
diff hgext/rebase.py @ 38499:999e5c218daf
rebase: suppress warning thrown when aborting rebase in case of dryrun
Before this patch dryrun output contained "rebase aborted" every
time we run rebase in dryrun mode and this warning does not sound
safe from a user prespective.
Differential Revision: https://phab.mercurial-scm.org/D3857
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Fri, 29 Jun 2018 01:05:08 +0530 |
parents | c892a30bafb9 |
children | 02004e5c6b56 |
line wrap: on
line diff
--- a/hgext/rebase.py Fri Jun 29 00:47:33 2018 +0530 +++ b/hgext/rebase.py Fri Jun 29 01:05:08 2018 +0530 @@ -325,7 +325,7 @@ skippedset.update(obsoleteextinctsuccessors) _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset) - def _prepareabortorcontinue(self, isabort, backup=True): + def _prepareabortorcontinue(self, isabort, backup=True, suppwarns=False): try: self.restorestatus() self.collapsemsg = restorecollapsemsg(self.repo, isabort) @@ -342,7 +342,8 @@ raise error.Abort(msg, hint=hint) if isabort: return abort(self.repo, self.originalwd, self.destmap, self.state, - activebookmark=self.activebookmark, backup=backup) + activebookmark=self.activebookmark, backup=backup, + suppwarns=suppwarns) def _preparenewrebase(self, destmap): if not destmap: @@ -851,7 +852,8 @@ return 0 finally: # no need to store backup in case of dryrun - rbsrt._prepareabortorcontinue(isabort=True, backup=False) + rbsrt._prepareabortorcontinue(isabort=True, backup=False, + suppwarns=True) def _dorebase(ui, repo, inmemory=False, **opts): rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts)) @@ -1554,7 +1556,8 @@ return False -def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True): +def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True, + suppwarns=False): '''Restore the repository to its original state. Additional args: activebookmark: the name of the bookmark that should be active after the @@ -1607,7 +1610,8 @@ finally: clearstatus(repo) clearcollapsemsg(repo) - repo.ui.warn(_('rebase aborted\n')) + if not suppwarns: + repo.ui.warn(_('rebase aborted\n')) return 0 def sortsource(destmap):