changeset 50139:ce657d7b7c39

large-files: open the transaction sooner in `scmutiladdremove` We want it to encompass the status call.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 22 Feb 2023 00:24:47 +0100
parents 270dc01481af
children f757788a6c25
files hgext/largefiles/overrides.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Wed Feb 22 00:22:16 2023 +0100
+++ b/hgext/largefiles/overrides.py	Wed Feb 22 00:24:47 2023 +0100
@@ -1552,6 +1552,11 @@
         opts = {}
     if not lfutil.islfilesrepo(repo):
         return orig(repo, matcher, prefix, uipathfn, opts, open_tr=open_tr)
+
+    # open the transaction and changing_files context
+    if open_tr is not None:
+        open_tr()
+
     # Get the list of missing largefiles so we can remove them
     lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
     unsure, s, mtime_boundary = lfdirstate.status(
@@ -1562,10 +1567,6 @@
         unknown=False,
     )
 
-    # open the transaction and changing_files context
-    if open_tr is not None:
-        open_tr()
-
     # Call into the normal remove code, but the removing of the standin, we want
     # to have handled by original addremove.  Monkey patching here makes sure
     # we don't remove the standin in the largefiles code, preventing a very