scmutil: use the optional badfn argument when building a matcher
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 05 Jun 2015 19:07:54 -0400
changeset 25466 007a1d53f7c3
parent 25465 f472228a9e5e
child 25467 f64dbe06f3d0
scmutil: use the optional badfn argument when building a matcher
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Fri Jun 05 19:01:04 2015 -0400
+++ b/mercurial/scmutil.py	Fri Jun 05 19:07:54 2015 -0400
@@ -798,11 +798,12 @@
     if not globbed and default == 'relpath':
         pats = expandpats(pats or [])
 
-    m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
-                         default, listsubrepos=opts.get('subrepos'))
     def badfn(f, msg):
         ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg))
-    m.bad = badfn
+
+    m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
+                  default, listsubrepos=opts.get('subrepos'), badfn=badfn)
+
     if m.always():
         pats = []
     return m, pats