comparison mercurial/cmdutil.py @ 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
comparison
equal deleted inserted replaced
25436:9724cbe2d546 25437:9c1bcd95b3ff
2249 return bad 2249 return bad
2250 2250
2251 def forget(ui, repo, match, prefix, explicitonly): 2251 def forget(ui, repo, match, prefix, explicitonly):
2252 join = lambda f: os.path.join(prefix, f) 2252 join = lambda f: os.path.join(prefix, f)
2253 bad = [] 2253 bad = []
2254 oldbad = match.bad 2254 badfn = lambda x, y: bad.append(x) or match.bad(x, y)
2255 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
2256 wctx = repo[None] 2255 wctx = repo[None]
2257 forgot = [] 2256 forgot = []
2258 s = repo.status(match=match, clean=True) 2257
2258 s = repo.status(match=matchmod.badmatch(match, badfn), clean=True)
2259 forget = sorted(s[0] + s[1] + s[3] + s[6]) 2259 forget = sorted(s[0] + s[1] + s[3] + s[6])
2260 if explicitonly: 2260 if explicitonly:
2261 forget = [f for f in forget if match.exact(f)] 2261 forget = [f for f in forget if match.exact(f)]
2262 2262
2263 for subpath in sorted(wctx.substate): 2263 for subpath in sorted(wctx.substate):