evolve: move logic to continue interrupted content-div resolution to new fn
Each of the other type has defined their own function to continue/complete the
interrupted resolution. We take out the logic for content-div resolution too in
a separate function to make the top level function looks clean.
--- a/hgext3rd/evolve/evolvecmd.py Mon Jun 11 01:12:12 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Sun Jun 10 20:35:48 2018 +0530
@@ -1547,22 +1547,7 @@
elif evolvestate['category'] == 'phasedivergent':
_completephasedivergent(ui, repo, evolvestate)
elif evolvestate['category'] == 'contentdivergent':
- tr = None
- try:
- tr = repo.transaction('evolve')
- divergent = evolvestate['divergent']
- other = evolvestate['other-divergent']
- base = evolvestate['base']
- repo = repo.unfiltered()
- ret = _completecontentdivergent(ui, repo, progresscb,
- repo[divergent],
- repo[other],
- repo[base],
- evolvestate)
- evolvestate['replacements'][divergent] = ret[1]
- tr.close()
- finally:
- tr.release()
+ _continuecontentdivergent(ui, repo, evolvestate, progresscb)
else:
repo.ui.status(_("continuing interrupted '%s' resolution is not yet"
" supported\n") % evolvestate['category'])
@@ -1586,6 +1571,25 @@
evolvestate['skippedrevs'].append(curctx.node())
return
+def _continuecontentdivergent(ui, repo, evolvestate, progresscb):
+ """function to continue the interrupted content-divergence resolution."""
+ tr = None
+ try:
+ tr = repo.transaction('evolve')
+ divergent = evolvestate['divergent']
+ other = evolvestate['other-divergent']
+ base = evolvestate['base']
+ repo = repo.unfiltered()
+ ret = _completecontentdivergent(ui, repo, progresscb,
+ repo[divergent],
+ repo[other],
+ repo[base],
+ evolvestate)
+ evolvestate['replacements'][divergent] = ret[1]
+ tr.close()
+ finally:
+ tr.release()
+
def _completephasedivergent(ui, repo, evolvestate):
"""function to complete the interrupted phase-divergence resolution.