# HG changeset patch # User Matt Harbison # Date 1433470278 14400 # Node ID 1a95c57959f6a35c95f2ba8e78cb71c26250d929 # Parent aaede04c0ba65672cdce60fb43fe2b6316dcddf4 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). diff -r aaede04c0ba6 -r 1a95c57959f6 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