comparison tests/test-revset.t @ 23994:8a2156780839

revset: replace parsing alias definition by _parsealiasdefn to parse strictly Before this patch, referring alias arguments is parsed by string base operation "str.replace". This causes problems below (see the previous patch introducing "_parsealiasdefn" for detail) - the shorter name argument breaks referring the longer name - argument names in the quoted string are broken This patch replaces parsing alias definition by "_parsealiasdefn" to parse strictly.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 02 Feb 2015 23:07:04 +0900
parents eeb5d5ab14a6
children bc75f8750cde
comparison
equal deleted inserted replaced
23993:eedade006458 23994:8a2156780839
1021 9 1021 9
1022 1022
1023 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" 1023 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
1024 ('symbol', 'tip') 1024 ('symbol', 'tip')
1025 warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token 1025 warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token
1026 9
1027 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
1028 $ try 'strictreplacing("foo", tip)'
1029 (func
1030 ('symbol', 'strictreplacing')
1031 (list
1032 ('string', 'foo')
1033 ('symbol', 'tip')))
1034 (or
1035 ('symbol', 'tip')
1036 (func
1037 ('symbol', 'desc')
1038 ('string', '$1')))
1026 9 1039 9
1027 1040
1028 $ try 'd(2:5)' 1041 $ try 'd(2:5)'
1029 (func 1042 (func
1030 ('symbol', 'd') 1043 ('symbol', 'd')