# HG changeset patch # User Pierre-Yves David # Date 2023-02-21 23:24:47 # Node ID ce657d7b7c394ad43f1e11898446b7a0c9f7d390 # Parent 270dc01481aff5ef5e4749648566e7f83b64a9a5 large-files: open the transaction sooner in `scmutiladdremove` We want it to encompass the status call. diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1552,6 +1552,11 @@ def scmutiladdremove( 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 @@ def scmutiladdremove( 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