hgext3rd/evolve/evolvecmd.py
changeset 5111 1fe3f7ffb462
parent 5075 fbe614cae40c
parent 5096 6742ce189373
child 5179 7c41a1ebcf7f
child 5210 b9b71fdea693
--- a/hgext3rd/evolve/evolvecmd.py	Mon Nov 04 00:18:55 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Feb 01 12:50:10 2020 +0100
@@ -280,7 +280,7 @@
                                flag=obsolete.bumpedfix, operation=b'evolve')
     bmupdate(newid)
     # reroute the working copy parent to the new changeset
-    with repo.dirstate.parentchange():
+    with repo.dirstate.parentchange(), compat.parentchange(repo):
         repo.dirstate.setparents(newid, nodemod.nullid)
     return (True, replacementnode)
 
@@ -635,7 +635,7 @@
         othernode = evolvestate[b'other-divergent']
         otherdiv = repo[othernode]
 
-        with repo.dirstate.parentchange():
+        with repo.dirstate.parentchange(), compat.parentchange(repo):
             repo.dirstate.setparents(publicnode, nodemod.nullid)
             dirstatedance(repo, divergent, publicnode, None)
         # check if node to be committed has changes same as public one
@@ -648,7 +648,7 @@
                                    operation=b'evolve')
             return (True, publicnode)
 
-    with repo.dirstate.parentchange():
+    with repo.dirstate.parentchange(), compat.parentchange(repo):
         repo.dirstate.setparents(resparent, nodemod.nullid)
 
     dirstatedance(repo, divergent, resparent, None)
@@ -999,7 +999,7 @@
         if not ctx.obsolete():
             continue
 
-        successors = obsutil.successorssets(repo, ctx.node(), cache)
+        successors = obsutil.successorssets(repo, ctx.node(), cache=cache)
 
         # We can't make any assumptions about how to update the hash if the
         # cset in question was split or diverged.
@@ -1014,7 +1014,7 @@
     assert tr is not None
     r = _evolvemerge(repo, orig, dest, pctx, keepbranch)
     if compat.hasconflict(r): # some conflict
-        with repo.dirstate.parentchange():
+        with repo.dirstate.parentchange(), compat.parentchange(repo):
             repo.setparents(dest.node(), orig.node())
             repo.dirstate.write(tr)
         hint = _(b"see 'hg help evolve.interrupted'")
@@ -1498,7 +1498,7 @@
         if n == ctx.node():
             # a node can't be a base for divergence with itself
             continue
-        nsuccsets = obsutil.successorssets(repo, n, cache)
+        nsuccsets = obsutil.successorssets(repo, n, cache=cache)
         for nsuccset in nsuccsets:
             if ctx.node() in nsuccset:
                 # we are only interested in *other* successor sets
@@ -2198,14 +2198,14 @@
             # p1 is obsolete and p2 is not obsolete, current working
             # directory parent should be successor of p1, so we should
             # set dirstate parents to (succ of p1, p2)
-            with repo.dirstate.parentchange():
+            with repo.dirstate.parentchange(), compat.parentchange(repo):
                 repo.dirstate.setparents(currentp1,
                                          ctxparents[1].node())
         elif p2obs and not p1obs:
             # p2 is obsolete and p1 is not obsolete, current working
             # directory parent should be successor of p2, so we should
             # set dirstate parents to (succ of p2, p1)
-            with repo.dirstate.parentchange():
+            with repo.dirstate.parentchange(), compat.parentchange(repo):
                 repo.dirstate.setparents(ctxparents[0].node(),
                                          currentp1)
 
@@ -2213,12 +2213,12 @@
             # both the parents were obsoleted, if orphanmerge is set, we
             # are processing the second parent first (to keep parent order)
             if evolvestate.get(b'orphanmerge'):
-                with repo.dirstate.parentchange():
+                with repo.dirstate.parentchange(), compat.parentchange(repo):
                     repo.dirstate.setparents(ctxparents[0].node(),
                                              currentp1)
             pass
     else:
-        with repo.dirstate.parentchange():
+        with repo.dirstate.parentchange(), compat.parentchange(repo):
             repo.dirstate.setparents(repo.dirstate.p1(), nodemod.nullid)
 
     with repo.ui.configoverride(overrides, b'evolve-continue'):