largefiles: replace match.bad() monkey patching with match.badmatch()
No known issues with the previous code since it restored the original method,
but this is cleaner.
The monkey patching in cat is harmless, because it is created locally, and
doesn't pass it anywhere (subrepo cat isn't supported with largefiles).
--- a/hgext/largefiles/overrides.py Thu Jun 04 22:02:22 2015 -0400
+++ b/hgext/largefiles/overrides.py Thu Jun 04 22:11:18 2015 -0400
@@ -100,10 +100,10 @@
lfmatcher = match_.match(repo.root, '', list(lfpats))
lfnames = []
- m = copy.copy(matcher)
- m.bad = lambda x, y: None
+ m = matcher
+
wctx = repo[None]
- for f in repo.walk(m):
+ for f in repo.walk(match_.badmatch(m, lambda x, y: None)):
exact = m.exact(f)
lfile = lfutil.standin(f) in wctx
nfile = f in wctx