Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 25439:aaede04c0ba6
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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 04 Jun 2015 22:02:22 -0400 |
parents | 7ce5a3230441 |
children | c2a4dfe2a336 |
comparison
equal
deleted
inserted
replaced
25438:7ce5a3230441 | 25439:aaede04c0ba6 |
---|---|
2836 | 2836 |
2837 # we'll need this later | 2837 # we'll need this later |
2838 targetsubs = sorted(s for s in wctx.substate if m(s)) | 2838 targetsubs = sorted(s for s in wctx.substate if m(s)) |
2839 | 2839 |
2840 if not m.always(): | 2840 if not m.always(): |
2841 m.bad = lambda x, y: False | 2841 for abs in repo.walk(matchmod.badmatch(m, lambda x, y: False)): |
2842 for abs in repo.walk(m): | |
2843 names[abs] = m.rel(abs), m.exact(abs) | 2842 names[abs] = m.rel(abs), m.exact(abs) |
2844 | 2843 |
2845 # walk target manifest to fill `names` | 2844 # walk target manifest to fill `names` |
2846 | 2845 |
2847 def badfn(path, msg): | 2846 def badfn(path, msg): |
2853 for f in names: | 2852 for f in names: |
2854 if f.startswith(path_): | 2853 if f.startswith(path_): |
2855 return | 2854 return |
2856 ui.warn("%s: %s\n" % (m.rel(path), msg)) | 2855 ui.warn("%s: %s\n" % (m.rel(path), msg)) |
2857 | 2856 |
2858 m.bad = badfn | 2857 for abs in ctx.walk(matchmod.badmatch(m, badfn)): |
2859 for abs in ctx.walk(m): | |
2860 if abs not in names: | 2858 if abs not in names: |
2861 names[abs] = m.rel(abs), m.exact(abs) | 2859 names[abs] = m.rel(abs), m.exact(abs) |
2862 | 2860 |
2863 # Find status of all file in `names`. | 2861 # Find status of all file in `names`. |
2864 m = scmutil.matchfiles(repo, names) | 2862 m = scmutil.matchfiles(repo, names) |