--- a/hgext3rd/evolve/evolvecmd.py Sun May 03 01:01:19 2020 +0200
+++ b/hgext3rd/evolve/evolvecmd.py Wed Apr 01 09:21:29 2020 -0700
@@ -444,6 +444,11 @@
return (True, divergent, other, resolutionparent, relocatereq)
+def _relocatedivergent(repo, orig, dest, evolvestate):
+ """relocates a divergent commit and saves the evolve state"""
+ with state.saver(evolvestate, {b'current': orig.node()}):
+ return _relocate(repo, orig, dest, evolvestate, keepbranch=True)
+
def _solvedivergent(ui, repo, divergent, evolvestate, displayer, dryrun=False,
confirm=False, progresscb=None):
"""tries to solve content-divergence of a changeset
@@ -521,9 +526,8 @@
evolvestate[b'relocating-div'] = True
ui.status(_(b'rebasing "divergent" content-divergent changeset %s on'
b' %s\n' % (divergent, repo[succsdivp1])))
- with state.saver(evolvestate, {b'current': divergent.node()}):
- newdivergent = _relocate(repo, divergent, repo[succsdivp1],
- evolvestate, keepbranch=True)
+ newdivergent = _relocatedivergent(repo, divergent, repo[succsdivp1],
+ evolvestate)
evolvestate[b'old-divergent'] = divergent.node()
divergent = repo[newdivergent]
evolvestate[b'relocating-div'] = False
@@ -543,9 +547,7 @@
evolvestate[b'relocating-other'] = True
ui.status(_(b'rebasing "other" content-divergent changeset %s on'
b' %s\n' % (other, divergent.p1())))
- with state.saver(evolvestate, {b'current': other.node()}):
- newother = _relocate(repo, other, divergent.p1(), evolvestate,
- keepbranch=True)
+ newother = _relocatedivergent(repo, other, divergent.p1(), evolvestate)
evolvestate[b'old-other'] = other.node()
other = repo[newother]
evolvestate[b'relocating-other'] = False
@@ -2059,9 +2061,8 @@
evolvestate[b'relocating-other'] = True
ui.status(_(b'rebasing "other" content-divergent changeset %s on'
b' %s\n' % (other, divergent.p1())))
- with state.saver(evolvestate, {b'current': other.node()}):
- newother = _relocate(repo, other, divergent.p1(),
- evolvestate, keepbranch=True)
+ newother = _relocatedivergent(repo, other, divergent.p1(),
+ evolvestate)
evolvestate[b'old-other'] = other.node()
other = repo[newother]
evolvestate[b'relocating-other'] = False