##// END OF EJS Templates
revset: handle re.compile() errors in grep()...
Brodie Rao -
r12320:40c40c6f stable
parent child Browse files
Show More
@@ -268,7 +268,10 b' def keyword(repo, subset, x):'
268 return l
268 return l
269
269
270 def grep(repo, subset, x):
270 def grep(repo, subset, x):
271 try:
271 gr = re.compile(getstring(x, _("grep wants a string")))
272 gr = re.compile(getstring(x, _("grep wants a string")))
273 except re.error, e:
274 raise error.ParseError(_('invalid match pattern: %s') % e)
272 l = []
275 l = []
273 for r in subset:
276 for r in subset:
274 c = repo[r]
277 c = repo[r]
@@ -110,6 +110,7 b" log 'descendants(2 or 3)'"
110 log 'file(b)'
110 log 'file(b)'
111 log 'follow()'
111 log 'follow()'
112 log 'grep("issue\d+")'
112 log 'grep("issue\d+")'
113 try 'grep("(")' # invalid regular expression
113 log 'head()'
114 log 'head()'
114 log 'heads(6::)'
115 log 'heads(6::)'
115 log 'keyword(issue)'
116 log 'keyword(issue)'
@@ -134,6 +134,9 b' 8'
134 9
134 9
135 % log 'grep("issue\d+")'
135 % log 'grep("issue\d+")'
136 6
136 6
137 % hg debugrevspec grep("(")
138 ('func', ('symbol', 'grep'), ('string', '('))
139 hg: parse error: invalid match pattern: unbalanced parenthesis
137 % log 'head()'
140 % log 'head()'
138 0
141 0
139 1
142 1
General Comments 0
You need to be logged in to leave comments. Login now