# HG changeset patch # User Matt Harbison # Date 2015-06-05 02:02:22 # Node ID aaede04c0ba65672cdce60fb43fe2b6316dcddf4 # Parent 7ce5a3230441f55b9c4349a9fbe84835aab93c20 revert: replace match.bad() monkey patching with match.badmatch() No known issues with the previous code since it immediately overwrote the patched, locally create matcher. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2838,8 +2838,7 @@ def revert(ui, repo, ctx, parents, *pats targetsubs = sorted(s for s in wctx.substate if m(s)) if not m.always(): - m.bad = lambda x, y: False - for abs in repo.walk(m): + for abs in repo.walk(matchmod.badmatch(m, lambda x, y: False)): names[abs] = m.rel(abs), m.exact(abs) # walk target manifest to fill `names` @@ -2855,8 +2854,7 @@ def revert(ui, repo, ctx, parents, *pats return ui.warn("%s: %s\n" % (m.rel(path), msg)) - m.bad = badfn - for abs in ctx.walk(m): + for abs in ctx.walk(matchmod.badmatch(m, badfn)): if abs not in names: names[abs] = m.rel(abs), m.exact(abs)