##// END OF EJS Templates
revset: parse x^:: as (x^):: (issue5764)...
Yuya Nishihara -
r35556:beb667c9 default
parent child Browse files
Show More
@@ -27,8 +27,10 b' elements = {'
27 27 "~": (18, None, None, ("ancestor", 18), None),
28 28 "^": (18, None, None, ("parent", 18), "parentpost"),
29 29 "-": (5, None, ("negate", 19), ("minus", 5), None),
30 "::": (17, None, ("dagrangepre", 17), ("dagrange", 17), "dagrangepost"),
31 "..": (17, None, ("dagrangepre", 17), ("dagrange", 17), "dagrangepost"),
30 "::": (17, "dagrangeall", ("dagrangepre", 17), ("dagrange", 17),
31 "dagrangepost"),
32 "..": (17, "dagrangeall", ("dagrangepre", 17), ("dagrange", 17),
33 "dagrangepost"),
32 34 ":": (15, "rangeall", ("rangepre", 15), ("range", 15), "rangepost"),
33 35 "not": (10, None, ("not", 10), None, None),
34 36 "!": (10, None, ("not", 10), None, None),
@@ -288,6 +290,8 b' def _fixops(x):'
288 290 post = ('parentpost', x[1])
289 291 if x[2][0] == 'dagrangepre':
290 292 return _fixops(('dagrange', post, x[2][1]))
293 elif x[2][0] == 'dagrangeall':
294 return _fixops(('dagrangepost', post))
291 295 elif x[2][0] == 'rangepre':
292 296 return _fixops(('range', post, x[2][1]))
293 297 elif x[2][0] == 'rangeall':
@@ -313,6 +317,8 b' def _analyze(x):'
313 317 return _analyze(_build('only(_, _)', *x[1:]))
314 318 elif op == 'onlypost':
315 319 return _analyze(_build('only(_)', x[1]))
320 elif op == 'dagrangeall':
321 raise error.ParseError(_("can't use '::' in this context"))
316 322 elif op == 'dagrangepre':
317 323 return _analyze(_build('ancestors(_)', x[1]))
318 324 elif op == 'dagrangepost':
@@ -792,7 +792,7 b' may be hidden (issue5385)'
792 792 * set:
793 793 <baseset []>
794 794
795 infix/suffix resolution of ^ operator (issue2884):
795 infix/suffix resolution of ^ operator (issue2884, issue5764):
796 796
797 797 x^:y means (x^):y
798 798
@@ -818,6 +818,17 b' infix/suffix resolution of ^ operator (i'
818 818 1
819 819 2
820 820
821 $ try '1^..2'
822 (dagrange
823 (parentpost
824 (symbol '1'))
825 (symbol '2'))
826 * set:
827 <baseset+ [0, 1, 2]>
828 0
829 1
830 2
831
821 832 $ try '9^:'
822 833 (rangepost
823 834 (parentpost
@@ -827,6 +838,24 b' infix/suffix resolution of ^ operator (i'
827 838 8
828 839 9
829 840
841 $ try '9^::'
842 (dagrangepost
843 (parentpost
844 (symbol '9')))
845 * set:
846 <generatorsetasc+>
847 8
848 9
849
850 $ try '9^..'
851 (dagrangepost
852 (parentpost
853 (symbol '9')))
854 * set:
855 <generatorsetasc+>
856 8
857 9
858
830 859 x^:y should be resolved before omitting group operators
831 860
832 861 $ try '1^(:2)'
@@ -944,6 +973,14 b' infix/suffix resolution of ^ operator (i'
944 973 hg: parse error: ^ expects a number 0, 1, or 2
945 974 [255]
946 975
976 '::' itself isn't a valid expression
977
978 $ try '::'
979 (dagrangeall
980 None)
981 hg: parse error: can't use '::' in this context
982 [255]
983
947 984 ancestor can accept 0 or more arguments
948 985
949 986 $ log 'ancestor()'
General Comments 0
You need to be logged in to leave comments. Login now