largefiles: replace match.bad() monkey patching with match.badmatch()
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 04 Jun 2015 22:11:18 -0400
changeset 25440 1a95c57959f6
parent 25439 aaede04c0ba6
child 25441 58b766a21189
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).
hgext/largefiles/overrides.py
--- 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