Show More
@@ -125,6 +125,11 b' class match(object):' | |||
|
125 | 125 | # by recursive traversal is visited. |
|
126 | 126 | traversedir = None |
|
127 | 127 | |
|
128 | def abs(self, f): | |
|
129 | '''Convert a repo path back to path that is relative to the root of the | |
|
130 | matcher.''' | |
|
131 | return f | |
|
132 | ||
|
128 | 133 | def rel(self, f): |
|
129 | 134 | '''Convert repo path back to path that is relative to cwd of matcher.''' |
|
130 | 135 | return util.pathto(self._root, self._cwd, f) |
@@ -188,6 +193,8 b' class narrowmatcher(match):' | |||
|
188 | 193 | >>> m1.bad = bad |
|
189 | 194 | >>> m2.bad('x.txt', 'No such file') |
|
190 | 195 | sub/x.txt: No such file |
|
196 | >>> m2.abs('c.txt') | |
|
197 | 'sub/c.txt' | |
|
191 | 198 | """ |
|
192 | 199 | |
|
193 | 200 | def __init__(self, path, matcher): |
@@ -204,6 +211,9 b' class narrowmatcher(match):' | |||
|
204 | 211 | self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn) |
|
205 | 212 | self._fmap = set(self._files) |
|
206 | 213 | |
|
214 | def abs(self, f): | |
|
215 | return self._matcher.abs(self._path + "/" + f) | |
|
216 | ||
|
207 | 217 | def bad(self, f, msg): |
|
208 | 218 | self._matcher.bad(self._path + "/" + f, msg) |
|
209 | 219 |
General Comments 0
You need to be logged in to leave comments.
Login now