D3870: rebase: add --confirm option

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Wed Jul 11 07:16:17 EDT 2018


yuja added a comment.


  Still can't apply. Which revision is this patch based on?
  
  >   with repo.wlock(), repo.lock():
  >       try:
  >           overrides = {('rebase', 'singletransaction'): True}
  >           with ui.configoverride(overrides, 'rebase'):
  >               _origrebase(ui, repo, opts, rbsrt, inmemory=True,
  >                           leaveunfinished=True, supptrwarns=True)
  >       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)
  >  +                if not ui.promptchoice(_(b'apply changes (yn)?'
  >  +                                         b'$$ &Yes $$ &No')):
  >  +                    _dorebase(ui, repo, opts, inmemory=False)
  > 
  >       return 1
  >   else:
  > 
  > - ui.status(_('dry-run rebase completed successfully; run without '
  > - '-n/--dry-run to perform this rebase\n')) +            if confirm: +                ui.status(_('rebase completed successfully\n')) +                if not ui.promptchoice(_(b'apply changes (yn)?' +                                         b'$$ &Yes $$ &No')):
  
  If KeyboardInterrupt is raised here for example, abort() wouldn't be called.
  
  >   finally:
  > 
  > - # no need to store backup in case of dryrun
  > - rbsrt._prepareabortorcontinue(isabort=True, backup=False,
  > - suppwarns=True) +            if not confirm: +                # no need to store backup in case of dryrun +                rbsrt._prepareabortorcontinue(isabort=True, backup=False, +                                              suppwarns=True)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3870

To: khanchi97, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list