changeset 25437:9c1bcd95b3ff

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).
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 04 Jun 2015 21:53:16 -0400
parents 9724cbe2d546
children 7ce5a3230441
files mercurial/cmdutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)]