##// END OF EJS Templates
largefiles: track if a matcher was tampered with...
Arseniy Alekseyev -
r52494:ea334310 default
parent child Browse files
Show More
@@ -71,6 +71,7 b' def composelargefilematcher(match, manif'
71 71 """create a matcher that matches only the largefiles in the original
72 72 matcher"""
73 73 m = copy.copy(match)
74 m._was_tampered_with = True
74 75 lfile = lambda f: lfutil.standin(f) in manifest
75 76 m._files = [lf for lf in m._files if lfile(lf)]
76 77 m._fileset = set(m._files)
@@ -86,6 +87,7 b' def composenormalfilematcher(match, mani'
86 87 excluded.update(exclude)
87 88
88 89 m = copy.copy(match)
90 m._was_tampered_with = True
89 91 notlfile = lambda f: not (
90 92 lfutil.isstandin(f) or lfutil.standin(f) in manifest or f in excluded
91 93 )
@@ -442,6 +444,8 b' def overridelog(orig, ui, repo, *pats, *'
442 444
443 445 pats.update(fixpats(f, tostandin) for f in p)
444 446
447 m._was_tampered_with = True
448
445 449 for i in range(0, len(m._files)):
446 450 # Don't add '.hglf' to m.files, since that is already covered by '.'
447 451 if m._files[i] == b'.':
@@ -849,6 +853,7 b' def overridecopy(orig, ui, repo, pats, o'
849 853 newpats.append(pat)
850 854 match = orig(ctx, newpats, opts, globbed, default, badfn=badfn)
851 855 m = copy.copy(match)
856 m._was_tampered_with = True
852 857 lfile = lambda f: lfutil.standin(f) in manifest
853 858 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
854 859 m._fileset = set(m._files)
@@ -967,6 +972,7 b' def overriderevert(orig, ui, repo, ctx, '
967 972 opts = {}
968 973 match = orig(mctx, pats, opts, globbed, default, badfn=badfn)
969 974 m = copy.copy(match)
975 m._was_tampered_with = True
970 976
971 977 # revert supports recursing into subrepos, and though largefiles
972 978 # currently doesn't work correctly in that case, this match is
@@ -1595,6 +1601,7 b' def scmutiladdremove('
1595 1601 # confused state later.
1596 1602 if s.deleted:
1597 1603 m = copy.copy(matcher)
1604 m._was_tampered_with = True
1598 1605
1599 1606 # The m._files and m._map attributes are not changed to the deleted list
1600 1607 # because that affects the m.exact() test, which in turn governs whether
@@ -1721,6 +1728,7 b' def overridecat(orig, ui, repo, file1, *'
1721 1728 err = 1
1722 1729 notbad = set()
1723 1730 m = scmutil.match(ctx, (file1,) + pats, pycompat.byteskwargs(opts))
1731 m._was_tampered_with = True
1724 1732 origmatchfn = m.matchfn
1725 1733
1726 1734 def lfmatchfn(f):
@@ -395,9 +395,15 b' def _donormalize(patterns, default, root'
395 395
396 396 class basematcher:
397 397 def __init__(self, badfn=None):
398 self._was_tampered_with = False
398 399 if badfn is not None:
399 400 self.bad = badfn
400 401
402 def was_tampered_with(self):
403 # [_was_tampered_with] is used to track if when extensions changed the matcher
404 # behavior (crazy stuff!), so we disable the rust fast path.
405 return self._was_tampered_with
406
401 407 def __call__(self, fn):
402 408 return self.matchfn(fn)
403 409
General Comments 0
You need to be logged in to leave comments. Login now