D3855: rebase: extract dryrun as a function

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Fri Jun 29 14:02:26 EDT 2018


khanchi97 added a comment.


  In https://phab.mercurial-scm.org/D3855#60250, @yuja wrote:
  
  > >   rbsrt = rebaseruntime(repo, ui, inmemory, opts)
  > >   with repo.wlock(), repo.lock():
  > >       try:
  > > 
  > > - overrides = {('rebase', 'singletransaction'): True}
  > > - with ui.configoverride(overrides, 'rebase'):
  > > - _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
  > > - leaveunfinished=True, **opts) +                _dryrunrebase(ui, repo, rbsrt, **opts) except error.InMemoryMergeConflictsError: ui.status(_('hit a merge conflict\n')) return 1
  >
  > Oops, I meant the whole dryrun process could be extracted to a function
  >  because it's getting bigger.
  >
  >   if dryrun:
  >       return _dryrunrebase(...)
  >   else:
  >       ...
  >
  >
  > But feel free to ignore my suggestion if there's a reason to not move
  >  everything.
  
  
  Aha, I thought you were pointing out to only "try:" block for more no. of indented blocks. I will update this.

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list