marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  In an ideal world, we would not have to do that. However, we are miles away 
from
  being ready to not have to do it.
  
  So we add this context manager alongside a long comment. This will help use to
  get to the point were have two distinct API with strict rules about when to 
call
  them.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11074

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6238,7 +6238,20 @@
 
         ms.commit()
         branchmerge = repo.dirstate.p2() != repo.nullid
-        mergestatemod.recordupdates(repo, ms.actions(), branchmerge, None)
+        # resolve is not doing a parent change here, however, `record updates`
+        # will call some dirstate API that at intended for parent changes call.
+        # Ideally we would not need this and could implement a lighter version
+        # of the recordupdateslogic that will not have to deal with the part
+        # related to parent changes. However this would requires that:
+        # - we are sure we passed around enough information at update/merge
+        #   time to no longer needs it at `hg resolve time`
+        # - we are sure we store that information well enough to be able to 
reuse it
+        # - we are the necessary logic to reuse it right.
+        #
+        # All this should eventually happens, but in the mean time, we use this
+        # context manager slightly out of the context it should be.
+        with repo.dirstate.parentchange():
+            mergestatemod.recordupdates(repo, ms.actions(), branchmerge, None)
 
         if not didwork and pats:
             hint = None



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to