lfconvert: use a `changing_parents` context to clear the dirstate
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 20 Feb 2023 11:37:05 +0100
changeset 50110 a860298776f0
parent 50109 bec7182cc406
child 50111 0ca8dc8a135f
lfconvert: use a `changing_parents` context to clear the dirstate Not sure if this is the right context, but it works and it is consistent with the other usages of `dirstate.clear`.
hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Mon Feb 20 11:57:46 2023 +0100
+++ b/hgext/largefiles/lfcommands.py	Mon Feb 20 11:37:05 2023 +0100
@@ -219,7 +219,8 @@
         success = True
     finally:
         if tolfile:
-            with rdst.dirstate.changing_files(rdst):
+            # XXX is this the right context semantically ?
+            with rdst.dirstate.changing_parents(rdst):
                 rdst.dirstate.clear()
             release(dstlock, dstwlock)
         if not success: