dirstate: use `dirstate.change_files` to scope the change in `lfconvert`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 13 Feb 2023 23:29:30 +0100
changeset 50051 9409f2946f16
parent 50050 22cd517bc6b0
child 50052 1b044a63a98a
dirstate: use `dirstate.change_files` to scope the change in `lfconvert` This is the way.
hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Sun Feb 05 12:09:52 2023 +0100
+++ b/hgext/largefiles/lfcommands.py	Mon Feb 13 23:29:30 2023 +0100
@@ -219,7 +219,8 @@
         success = True
     finally:
         if tolfile:
-            rdst.dirstate.clear()
+            with rdst.dirstate.changing_files(rdst):
+                rdst.dirstate.clear()
             release(dstlock, dstwlock)
         if not success:
             # we failed, remove the new directory