##// END OF EJS Templates
revset: don't error out if tokens parse as existing symbols...
Jordi Gutiérrez Hermoso -
r24932:02228215 default
parent child Browse files
Show More
@@ -334,11 +334,6 b' def stringset(repo, subset, x):'
334 return baseset([x])
334 return baseset([x])
335 return baseset()
335 return baseset()
336
336
337 def symbolset(repo, subset, x):
338 if x in symbols:
339 raise error.ParseError(_("can't use %s here") % x)
340 return stringset(repo, subset, x)
341
342 def rangeset(repo, subset, x, y):
337 def rangeset(repo, subset, x, y):
343 m = getset(repo, fullreposet(repo), x)
338 m = getset(repo, fullreposet(repo), x)
344 n = getset(repo, fullreposet(repo), y)
339 n = getset(repo, fullreposet(repo), y)
@@ -2088,7 +2083,7 b' methods = {'
2088 "range": rangeset,
2083 "range": rangeset,
2089 "dagrange": dagrange,
2084 "dagrange": dagrange,
2090 "string": stringset,
2085 "string": stringset,
2091 "symbol": symbolset,
2086 "symbol": stringset,
2092 "and": andset,
2087 "and": andset,
2093 "or": orset,
2088 "or": orset,
2094 "not": notset,
2089 "not": notset,
@@ -281,7 +281,7 b' quoting needed'
281 hg: parse error: date requires a string
281 hg: parse error: date requires a string
282 [255]
282 [255]
283 $ log 'date'
283 $ log 'date'
284 hg: parse error: can't use date here
284 abort: unknown revision 'date'!
285 [255]
285 [255]
286 $ log 'date('
286 $ log 'date('
287 hg: parse error at 5: not a prefix: end
287 hg: parse error at 5: not a prefix: end
@@ -289,11 +289,40 b' quoting needed'
289 $ log 'date(tip)'
289 $ log 'date(tip)'
290 abort: invalid date: 'tip'
290 abort: invalid date: 'tip'
291 [255]
291 [255]
292 $ log '"date"'
292 $ log '0:date'
293 abort: unknown revision 'date'!
294 [255]
295 $ log '::"date"'
293 abort: unknown revision 'date'!
296 abort: unknown revision 'date'!
294 [255]
297 [255]
298 $ hg book date -r 4
299 $ log '0:date'
300 0
301 1
302 2
303 3
304 4
305 $ log '::date'
306 0
307 1
308 2
309 4
310 $ log '::"date"'
311 0
312 1
313 2
314 4
295 $ log 'date(2005) and 1::'
315 $ log 'date(2005) and 1::'
296 4
316 4
317 $ hg book -d date
318
319 Test that symbols only get parsed as functions if there's an opening
320 parenthesis.
321
322 $ hg book only -r 9
323 $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark
324 8
325 9
297
326
298 ancestor can accept 0 or more arguments
327 ancestor can accept 0 or more arguments
299
328
General Comments 0
You need to be logged in to leave comments. Login now