changeset 51634:e32f23f15623

largefiles: mark more matchers as having been tampered with These happened to slip through the cracks earlier because they weren't caught by tests. Now that we're enabling rust fast path more widely these start breaking.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Fri, 26 Apr 2024 19:43:42 +0100
parents 59f846fbc11d
children aa23b19e6da4
files hgext/largefiles/lfutil.py hgext/largefiles/reposetup.py
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Mon May 06 18:50:21 2024 +0200
+++ b/hgext/largefiles/lfutil.py	Fri Apr 26 19:43:42 2024 +0100
@@ -430,6 +430,7 @@
     def composedmatchfn(f):
         return isstandin(f) and rmatcher.matchfn(splitstandin(f))
 
+    smatcher._was_tampered_with = True
     smatcher.matchfn = composedmatchfn
 
     return smatcher
@@ -716,6 +717,7 @@
         return match
 
     lfiles = listlfiles(repo)
+    match._was_tampered_with = True
     match._files = repo._subdirlfs(match.files(), lfiles)
 
     # Case 2: user calls commit with specified patterns: refresh
@@ -746,6 +748,7 @@
     # user.  Have to modify _files to prevent commit() from
     # complaining "not tracked" for big files.
     match = copy.copy(match)
+    match._was_tampered_with = True
     origmatchfn = match.matchfn
 
     # Check both the list of largefiles and the list of
--- a/hgext/largefiles/reposetup.py	Mon May 06 18:50:21 2024 +0200
+++ b/hgext/largefiles/reposetup.py	Fri Apr 26 19:43:42 2024 +0100
@@ -181,6 +181,7 @@
                     return newfiles
 
                 m = copy.copy(match)
+                m._was_tampered_with = True
                 m._files = tostandins(m._files)
 
                 result = orig(
@@ -193,6 +194,7 @@
                         dirstate = self.dirstate
                         return sf in dirstate or dirstate.hasdir(sf)
 
+                    match._was_tampered_with = True
                     match._files = [f for f in match._files if sfindirstate(f)]
                     # Don't waste time getting the ignored and unknown
                     # files from lfdirstate