largefile: replace the `normallookup` call when creating a new lfdirstate
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 19 Jul 2021 02:44:11 +0200
changeset 47723 0ed2f74f6e3a
parent 47722 47dce5a99eab
child 47724 b0a39b666e2d
largefile: replace the `normallookup` call when creating a new lfdirstate This is the newer, more semantic API. Differential Revision: https://phab.mercurial-scm.org/D11165
hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py	Mon Jul 19 05:46:16 2021 +0200
+++ b/hgext/largefiles/lfutil.py	Mon Jul 19 02:44:11 2021 +0200
@@ -229,9 +229,12 @@
         if len(standins) > 0:
             vfs.makedirs(lfstoredir)
 
-        for standin in standins:
-            lfile = splitstandin(standin)
-            lfdirstate.normallookup(lfile)
+        with lfdirstate.parentchange():
+            for standin in standins:
+                lfile = splitstandin(standin)
+                lfdirstate.update_file(
+                    lfile, p1_tracked=True, wc_tracked=True, possibly_dirty=True
+                )
     return lfdirstate