Mercurial > hg
comparison mercurial/scmutil.py @ 25434:5984dd42e140
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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 04 Jun 2015 21:25:07 -0400 |
parents | c0995cd8ff6f |
children | 007a1d53f7c3 |
comparison
equal
deleted
inserted
replaced
25433:419ac63fe29c | 25434:5984dd42e140 |
---|---|
848 except error.LookupError: | 848 except error.LookupError: |
849 repo.ui.status(_("skipping missing subrepository: %s\n") | 849 repo.ui.status(_("skipping missing subrepository: %s\n") |
850 % join(subpath)) | 850 % join(subpath)) |
851 | 851 |
852 rejected = [] | 852 rejected = [] |
853 origbad = m.bad | |
854 def badfn(f, msg): | 853 def badfn(f, msg): |
855 if f in m.files(): | 854 if f in m.files(): |
856 origbad(f, msg) | 855 m.bad(f, msg) |
857 rejected.append(f) | 856 rejected.append(f) |
858 | 857 |
859 m.bad = badfn | 858 badmatch = matchmod.badmatch(m, badfn) |
860 added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) | 859 added, unknown, deleted, removed, forgotten = _interestingfiles(repo, |
861 m.bad = origbad | 860 badmatch) |
862 | 861 |
863 unknownset = set(unknown + forgotten) | 862 unknownset = set(unknown + forgotten) |
864 toprint = unknownset.copy() | 863 toprint = unknownset.copy() |
865 toprint.update(deleted) | 864 toprint.update(deleted) |
866 for abs in sorted(toprint): | 865 for abs in sorted(toprint): |