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).
--- 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)]