changeset 47649:4b17971f0181

largefile: use parentchange during mergerecordupdates This match what core is doing around recordupdates. Differential Revision: https://phab.mercurial-scm.org/D11105
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Jul 2021 01:24:11 +0200
parents 093b1df410c9
children 1e5a9783bba8
files hgext/largefiles/overrides.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Thu Jul 08 01:23:30 2021 +0200
+++ b/hgext/largefiles/overrides.py	Thu Jul 08 01:24:11 2021 +0200
@@ -650,12 +650,15 @@
 def mergerecordupdates(orig, repo, actions, branchmerge, getfiledata):
     if MERGE_ACTION_LARGEFILE_MARK_REMOVED in actions:
         lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
-        for lfile, args, msg in actions[MERGE_ACTION_LARGEFILE_MARK_REMOVED]:
-            # this should be executed before 'orig', to execute 'remove'
-            # before all other actions
-            repo.dirstate.remove(lfile)
-            # make sure lfile doesn't get synclfdirstate'd as normal
-            lfdirstate.add(lfile)
+        with lfdirstate.parentchange():
+            for lfile, args, msg in actions[
+                MERGE_ACTION_LARGEFILE_MARK_REMOVED
+            ]:
+                # this should be executed before 'orig', to execute 'remove'
+                # before all other actions
+                repo.dirstate.remove(lfile)
+                # make sure lfile doesn't get synclfdirstate'd as normal
+                lfdirstate.add(lfile)
         lfdirstate.write()
 
     return orig(repo, actions, branchmerge, getfiledata)