Show More
@@ -256,8 +256,11 b' def grep(mctx, x):' | |||||
256 | """``grep(regex)`` |
|
256 | """``grep(regex)`` | |
257 | File contains the given regular expression. |
|
257 | File contains the given regular expression. | |
258 | """ |
|
258 | """ | |
259 | pat = getstring(x, _("grep requires a pattern")) |
|
259 | try: | |
260 | r = re.compile(pat) |
|
260 | # i18n: "grep" is a keyword | |
|
261 | r = re.compile(getstring(x, _("grep requires a pattern"))) | |||
|
262 | except re.error, e: | |||
|
263 | raise error.ParseError(_('invalid match pattern: %s') % e) | |||
261 | return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())] |
|
264 | return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())] | |
262 |
|
265 | |||
263 | _units = dict(k=2**10, K=2**10, kB=2**10, KB=2**10, |
|
266 | _units = dict(k=2**10, K=2**10, kB=2**10, KB=2**10, |
General Comments 0
You need to be logged in to leave comments.
Login now