changeset 25440:1a95c57959f6

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).
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 04 Jun 2015 22:11:18 -0400
parents aaede04c0ba6
children 58b766a21189
files hgext/largefiles/overrides.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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