Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 25466:007a1d53f7c3
scmutil: use the optional badfn argument when building a matcher
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 05 Jun 2015 19:07:54 -0400 |
parents | 5984dd42e140 |
children | f64dbe06f3d0 |
comparison
equal
deleted
inserted
replaced
25465:f472228a9e5e | 25466:007a1d53f7c3 |
---|---|
796 if pats == ("",): | 796 if pats == ("",): |
797 pats = [] | 797 pats = [] |
798 if not globbed and default == 'relpath': | 798 if not globbed and default == 'relpath': |
799 pats = expandpats(pats or []) | 799 pats = expandpats(pats or []) |
800 | 800 |
801 m = ctx.match(pats, opts.get('include'), opts.get('exclude'), | |
802 default, listsubrepos=opts.get('subrepos')) | |
803 def badfn(f, msg): | 801 def badfn(f, msg): |
804 ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg)) | 802 ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg)) |
805 m.bad = badfn | 803 |
804 m = ctx.match(pats, opts.get('include'), opts.get('exclude'), | |
805 default, listsubrepos=opts.get('subrepos'), badfn=badfn) | |
806 | |
806 if m.always(): | 807 if m.always(): |
807 pats = [] | 808 pats = [] |
808 return m, pats | 809 return m, pats |
809 | 810 |
810 def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): | 811 def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): |