Mercurial > hg-stable
diff mercurial/cmdutil.py @ 25438:7ce5a3230441
cat: 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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 04 Jun 2015 21:55:56 -0400 |
parents | 9c1bcd95b3ff |
children | aaede04c0ba6 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Jun 04 21:53:16 2015 -0400 +++ b/mercurial/cmdutil.py Thu Jun 04 21:55:56 2015 -0400 @@ -2437,22 +2437,16 @@ return 0 # Don't warn about "missing" files that are really in subrepos - bad = matcher.bad - def badfn(path, msg): for subpath in ctx.substate: if path.startswith(subpath): return - bad(path, msg) - - matcher.bad = badfn - - for abs in ctx.walk(matcher): + matcher.bad(path, msg) + + for abs in ctx.walk(matchmod.badmatch(matcher, badfn)): write(abs) err = 0 - matcher.bad = bad - for subpath in sorted(ctx.substate): sub = ctx.sub(subpath) try: