# HG changeset patch # User Matt Harbison # Date 1433469196 14400 # Node ID 9c1bcd95b3ff5402bab6904e45094b42c07badf3 # Parent 9724cbe2d546d3c662dfd815d018e3ecfbd3eec4 forget: replace match.bad() monkey patching with match.badmatch() The previous code didn't restore the original method, but it looks like the worst that would happen is junk added to a list that had already been processed by previous subrepo invocation(s). diff -r 9724cbe2d546 -r 9c1bcd95b3ff mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Jun 04 21:49:50 2015 -0400 +++ b/mercurial/cmdutil.py Thu Jun 04 21:53:16 2015 -0400 @@ -2251,11 +2251,11 @@ def forget(ui, repo, match, prefix, explicitonly): join = lambda f: os.path.join(prefix, f) bad = [] - oldbad = match.bad - match.bad = lambda x, y: bad.append(x) or oldbad(x, y) + badfn = lambda x, y: bad.append(x) or match.bad(x, y) wctx = repo[None] forgot = [] - s = repo.status(match=match, clean=True) + + s = repo.status(match=matchmod.badmatch(match, badfn), clean=True) forget = sorted(s[0] + s[1] + s[3] + s[6]) if explicitonly: forget = [f for f in forget if match.exact(f)]