mercurial/match.py
changeset 42080 f3db5c805a67
parent 41676 0531dff73d0b
child 42081 bf777c1e78dd
--- a/mercurial/match.py	Fri Apr 05 11:24:00 2019 -0700
+++ b/mercurial/match.py	Sun Apr 07 12:21:23 2019 +0200
@@ -568,8 +568,24 @@
         return ('<includematcher includes=%r>' % pycompat.bytestr(self._pats))
 
 class exactmatcher(basematcher):
-    '''Matches the input files exactly. They are interpreted as paths, not
+    r'''Matches the input files exactly. They are interpreted as paths, not
     patterns (so no kind-prefixes).
+
+    >>> m = exactmatcher(['a.txt', 're:.*\.c$'])
+    >>> m('a.txt')
+    True
+    >>> m('b.txt')
+    False
+
+    Input files that would be matched are exactly those returned by .files()
+    >>> m.files()
+    ['a.txt', 're:.*\\.c$']
+
+    So pattern 're:.*\.c$' is not considered as a regex, but as a file name
+    >>> m('main.c')
+    False
+    >>> m('re:.*\.c$')
+    True
     '''
 
     def __init__(self, files, badfn=None):