touch: use repo.setparents() instead of repo.dirstate.setparents() draft stable
authorAnton Shestakov <av6@dwimlabs.net>
Sun, 26 Jan 2020 20:57:20 +0700
branchstable
changeset 5247 5a2e7c6f9174
parent 5246 814083e5f7e8
child 5248 fa20e48b7713
touch: use repo.setparents() instead of repo.dirstate.setparents() setparents() was added to localrepository class in 2012, and now we finally have some differences between calling repo.setparents() vs repo.dirstate.setparents(): _quick_access_* things, introduced in hg 5.3. This patch fixes potential quick-access desync problems where repo[b'.'] would be different from repo.dirstate.p1().
hgext3rd/evolve/cmdrewrite.py
--- a/hgext3rd/evolve/cmdrewrite.py	Sun Jan 26 20:57:39 2020 +0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Sun Jan 26 20:57:20 2020 +0700
@@ -1451,7 +1451,7 @@
         phases.retractboundary(repo, tr, ctx.phase(), [new])
         if ctx in repo[None].parents():
             with repo.dirstate.parentchange():
-                repo.dirstate.setparents(new, node.nullid)
+                repo.setparents(new, node.nullid)
 
 @eh.command(
     b'pick|grab',