To avoid more number of indented blocks and make it easier to add
additional functionality in dryrun, extracted as a function.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGc92fdc27cbdd: rebase: extract dryrun as a function
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
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.
Comment Actions
Aha, I thought you were pointing out to only "try:" block for more no. of indented blocks. I will update this.