D3870: rebase: add --confirm option
Yuya Nishihara
yuya at tcha.org
Thu Jul 12 13:14:39 UTC 2018
Queued, thanks.
> - ui.status(_('starting dry-run rebase; repository will not be changed\n'))
> + confirm = opts.get('confirm')
> + if confirm:
> + ui.status(_('starting rebase...\n'))
Nit: this message is misleading since nothing will be committed until
accepting the changes. Can you remove it? Or alternatively, we can say that
you're doing rebase in-memory so you're safe.
> with repo.wlock(), repo.lock():
> try:
> + needsabort = True
Moved this before the "try".
> except error.InMemoryMergeConflictsError:
> ui.status(_('hit a merge conflict\n'))
> + if confirm:
> + # abort as in-memory merge doesn't support conflict
> + rbsrt._prepareabortorcontinue(isabort=True, backup=False,
> + suppwarns=True)
> + needsabort = False
> + if not ui.promptchoice(_(b'apply changes (yn)?'
> + b'$$ &Yes $$ &No')):
Nit: This isn't actually "apply changes".
> + _dorebase(ui, repo, opts, inmemory=False)
`return _dorebase(...)` to not loose the actual result code. Can you
fix by a follow-up patch?
More information about the Mercurial-devel
mailing list