Show More
@@ -325,13 +325,13 b' class basealiasrules(object):' | |||||
325 | >>> builddecl('foo') |
|
325 | >>> builddecl('foo') | |
326 | ('foo', None, None) |
|
326 | ('foo', None, None) | |
327 | >>> builddecl('$foo') |
|
327 | >>> builddecl('$foo') | |
328 |
('$foo', None, " |
|
328 | ('$foo', None, "invalid symbol '$foo'") | |
329 | >>> builddecl('foo::bar') |
|
329 | >>> builddecl('foo::bar') | |
330 | ('foo::bar', None, 'invalid format') |
|
330 | ('foo::bar', None, 'invalid format') | |
331 | >>> builddecl('foo()') |
|
331 | >>> builddecl('foo()') | |
332 | ('foo', [], None) |
|
332 | ('foo', [], None) | |
333 | >>> builddecl('$foo()') |
|
333 | >>> builddecl('$foo()') | |
334 |
('$foo()', None, " |
|
334 | ('$foo()', None, "invalid function '$foo'") | |
335 | >>> builddecl('foo($1, $2)') |
|
335 | >>> builddecl('foo($1, $2)') | |
336 | ('foo', ['$1', '$2'], None) |
|
336 | ('foo', ['$1', '$2'], None) | |
337 | >>> builddecl('foo(bar_bar, baz.baz)') |
|
337 | >>> builddecl('foo(bar_bar, baz.baz)') | |
@@ -358,7 +358,7 b' class basealiasrules(object):' | |||||
358 | # "name = ...." style |
|
358 | # "name = ...." style | |
359 | name = tree[1] |
|
359 | name = tree[1] | |
360 | if name.startswith('$'): |
|
360 | if name.startswith('$'): | |
361 |
return (decl, None, _("' |
|
361 | return (decl, None, _("invalid symbol '%s'") % name) | |
362 | return (name, None, None) |
|
362 | return (name, None, None) | |
363 |
|
363 | |||
364 | func = cls._trygetfunc(tree) |
|
364 | func = cls._trygetfunc(tree) | |
@@ -366,7 +366,7 b' class basealiasrules(object):' | |||||
366 | # "name(arg, ....) = ...." style |
|
366 | # "name(arg, ....) = ...." style | |
367 | name, args = func |
|
367 | name, args = func | |
368 | if name.startswith('$'): |
|
368 | if name.startswith('$'): | |
369 |
return (decl, None, _("' |
|
369 | return (decl, None, _("invalid function '%s'") % name) | |
370 | if any(t[0] != cls._symbolnode for t in args): |
|
370 | if any(t[0] != cls._symbolnode for t in args): | |
371 | return (decl, None, _("invalid argument list")) |
|
371 | return (decl, None, _("invalid argument list")) | |
372 | if len(args) != len(set(args)): |
|
372 | if len(args) != len(set(args)): | |
@@ -389,7 +389,7 b' class basealiasrules(object):' | |||||
389 | if sym in args: |
|
389 | if sym in args: | |
390 | op = '_aliasarg' |
|
390 | op = '_aliasarg' | |
391 | elif sym.startswith('$'): |
|
391 | elif sym.startswith('$'): | |
392 |
raise error.ParseError(_("' |
|
392 | raise error.ParseError(_("invalid symbol '%s'") % sym) | |
393 | return (op, sym) |
|
393 | return (op, sym) | |
394 |
|
394 | |||
395 | @classmethod |
|
395 | @classmethod | |
@@ -423,7 +423,7 b' class basealiasrules(object):' | |||||
423 | ... builddefn('$1 or $bar', args) |
|
423 | ... builddefn('$1 or $bar', args) | |
424 | ... except error.ParseError as inst: |
|
424 | ... except error.ParseError as inst: | |
425 | ... print parseerrordetail(inst) |
|
425 | ... print parseerrordetail(inst) | |
426 | '$' not for alias arguments |
|
426 | invalid symbol '$bar' | |
427 | >>> args = ['$1', '$10', 'foo'] |
|
427 | >>> args = ['$1', '$10', 'foo'] | |
428 | >>> pprint(builddefn('$10 or baz', args)) |
|
428 | >>> pprint(builddefn('$10 or baz', args)) | |
429 | (or |
|
429 | (or |
@@ -1967,7 +1967,7 b' test unknown reference:' | |||||
1967 | (func |
|
1967 | (func | |
1968 | ('symbol', 'unknownref') |
|
1968 | ('symbol', 'unknownref') | |
1969 | ('symbol', '0')) |
|
1969 | ('symbol', '0')) | |
1970 |
abort: failed to parse the definition of revset alias "unknownref": |
|
1970 | abort: failed to parse the definition of revset alias "unknownref": invalid symbol '$2' | |
1971 | [255] |
|
1971 | [255] | |
1972 |
|
1972 | |||
1973 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
|
1973 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
General Comments 0
You need to be logged in to leave comments.
Login now