# HG changeset patch # User Matt Harbison # Date 2015-06-05 01:25:07 # Node ID 5984dd42e140798065221be714f6c675c421a939 # Parent 419ac63fe29ccb38a97a9ed6d49632c7ba8e2745 addremove: 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. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -850,15 +850,14 @@ def addremove(repo, matcher, prefix, opt % join(subpath)) rejected = [] - origbad = m.bad def badfn(f, msg): if f in m.files(): - origbad(f, msg) + m.bad(f, msg) rejected.append(f) - m.bad = badfn - added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) - m.bad = origbad + badmatch = matchmod.badmatch(m, badfn) + added, unknown, deleted, removed, forgotten = _interestingfiles(repo, + badmatch) unknownset = set(unknown + forgotten) toprint = unknownset.copy()