D3870: rebase: add --confirm option

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Wed Jul 11 08:22:43 EDT 2018


khanchi97 added a comment.


  In https://phab.mercurial-scm.org/D3870#61079, @yuja wrote:
  
  > Still can't apply. Which revision is this patch based on?
  
  
  Ah, this patch is based on https://phab.mercurial-scm.org/D3830 which is not reviewed. Do I need to rebase this to hg-commited current tip?
  
  > 
  > 
  >>   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.
  
  okay, can I update this patch or send a follow-up to handle KeyboardInterrupt?
  
  > 
  > 
  >>   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