[Updated] [+ ] D11108: largefile: use `parentchange` during rollback

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Jul 19 14:50:22 UTC 2021


marmoute updated this revision to Diff 29467.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11108?vs=29434&id=29467

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11108/new/

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

AFFECTED FILES
  hgext/largefiles/overrides.py

CHANGE DETAILS

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1636,13 +1636,14 @@
             repo.wvfs.unlinkpath(standin, ignoremissing=True)
 
         lfdirstate = lfutil.openlfdirstate(ui, repo)
-        orphans = set(lfdirstate)
-        lfiles = lfutil.listlfiles(repo)
-        for file in lfiles:
-            lfutil.synclfdirstate(repo, lfdirstate, file, True)
-            orphans.discard(file)
-        for lfile in orphans:
-            lfdirstate.drop(lfile)
+        with lfdirstate.parentchange():
+            orphans = set(lfdirstate)
+            lfiles = lfutil.listlfiles(repo)
+            for file in lfiles:
+                lfutil.synclfdirstate(repo, lfdirstate, file, True)
+                orphans.discard(file)
+            for lfile in orphans:
+                lfdirstate.drop(lfile)
         lfdirstate.write()
     return result
 



To: marmoute, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210719/52913eb7/attachment-0002.html>


More information about the Mercurial-patches mailing list