mercurial/match.py
changeset 12268 83aaeba32b88
parent 12267 69e43c0515f2
child 13218 1f4721de2ca9
--- a/mercurial/match.py	Mon Sep 13 13:08:18 2010 +0200
+++ b/mercurial/match.py	Mon Sep 13 13:09:09 2010 +0200
@@ -131,6 +131,11 @@
     True
     >>> m2.rel('b.txt')
     'b.txt'
+    >>> def bad(f, msg):
+    ...     print "%s: %s" % (f, msg)
+    >>> m1.bad = bad
+    >>> m2.bad('x.txt', 'No such file')
+    sub/x.txt: No such file
     """
 
     def __init__(self, path, matcher):
@@ -145,6 +150,9 @@
         self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
         self._fmap = set(self._files)
 
+    def bad(self, f, msg):
+        self._matcher.bad(self._path + "/" + f, msg)
+
 def patkind(pat):
     return _patsplit(pat, None)[0]