##// END OF EJS Templates
smartset: change repr of spanset to show revisions as half-open range...
Yuya Nishihara -
r32817:e962c70c default
parent child Browse files
Show More
@@ -1021,7 +1021,7 b' class spanset(abstractsmartset):'
1021 def __repr__(self):
1021 def __repr__(self):
1022 d = {False: '-', True: '+'}[self._ascending]
1022 d = {False: '-', True: '+'}[self._ascending]
1023 return '<%s%s %d:%d>' % (type(self).__name__, d,
1023 return '<%s%s %d:%d>' % (type(self).__name__, d,
1024 self._start, self._end - 1)
1024 self._start, self._end)
1025
1025
1026 class fullreposet(spanset):
1026 class fullreposet(spanset):
1027 """a set containing all revisions in the repo
1027 """a set containing all revisions in the repo
@@ -157,7 +157,7 b' trivial'
157 ('symbol', '0')
157 ('symbol', '0')
158 ('symbol', '1'))
158 ('symbol', '1'))
159 * set:
159 * set:
160 <spanset+ 0:1>
160 <spanset+ 0:2>
161 0
161 0
162 1
162 1
163 $ try --optimize :
163 $ try --optimize :
@@ -168,7 +168,7 b' trivial'
168 None
168 None
169 define)
169 define)
170 * set:
170 * set:
171 <spanset+ 0:9>
171 <spanset+ 0:10>
172 0
172 0
173 1
173 1
174 2
174 2
@@ -266,7 +266,7 b' names that should be caught by fallback '
266 (rangepost
266 (rangepost
267 ('symbol', '+a+b+c+'))
267 ('symbol', '+a+b+c+'))
268 * set:
268 * set:
269 <spanset+ 3:9>
269 <spanset+ 3:10>
270 3
270 3
271 4
271 4
272 5
272 5
@@ -278,7 +278,7 b' names that should be caught by fallback '
278 (rangepre
278 (rangepre
279 ('symbol', '+a+b+c+'))
279 ('symbol', '+a+b+c+'))
280 * set:
280 * set:
281 <spanset+ 0:3>
281 <spanset+ 0:4>
282 0
282 0
283 1
283 1
284 2
284 2
@@ -288,7 +288,7 b' names that should be caught by fallback '
288 ('symbol', '-a-b-c-')
288 ('symbol', '-a-b-c-')
289 ('symbol', '+a+b+c+'))
289 ('symbol', '+a+b+c+'))
290 * set:
290 * set:
291 <spanset- 3:4>
291 <spanset- 3:5>
292 4
292 4
293 3
293 3
294 $ log '-a-b-c-:+a+b+c+'
294 $ log '-a-b-c-:+a+b+c+'
@@ -626,7 +626,7 b' may be hidden (issue5385)'
626 None
626 None
627 define)
627 define)
628 * set:
628 * set:
629 <spanset+ 0:9>
629 <spanset+ 0:10>
630 0
630 0
631 1
631 1
632 2
632 2
@@ -643,7 +643,7 b' may be hidden (issue5385)'
643 ('symbol', '1')
643 ('symbol', '1')
644 define)
644 define)
645 * set:
645 * set:
646 <spanset+ 0:1>
646 <spanset+ 0:2>
647 0
647 0
648 1
648 1
649 $ try -p analyzed ':(1|2)'
649 $ try -p analyzed ':(1|2)'
@@ -656,7 +656,7 b' may be hidden (issue5385)'
656 define)
656 define)
657 define)
657 define)
658 * set:
658 * set:
659 <spanset+ 0:2>
659 <spanset+ 0:3>
660 0
660 0
661 1
661 1
662 2
662 2
@@ -681,7 +681,7 b' infix/suffix resolution of ^ operator (i'
681 ('symbol', '1'))
681 ('symbol', '1'))
682 ('symbol', '2'))
682 ('symbol', '2'))
683 * set:
683 * set:
684 <spanset+ 0:2>
684 <spanset+ 0:3>
685 0
685 0
686 1
686 1
687 2
687 2
@@ -702,7 +702,7 b' infix/suffix resolution of ^ operator (i'
702 (parentpost
702 (parentpost
703 ('symbol', '9')))
703 ('symbol', '9')))
704 * set:
704 * set:
705 <spanset+ 8:9>
705 <spanset+ 8:10>
706 8
706 8
707 9
707 9
708
708
@@ -727,7 +727,7 b' infix/suffix resolution of ^ operator (i'
727 ('symbol', '1'))
727 ('symbol', '1'))
728 ('symbol', '2')))
728 ('symbol', '2')))
729 * set:
729 * set:
730 <spanset+ 0:2>
730 <spanset+ 0:3>
731 0
731 0
732 1
732 1
733 2
733 2
@@ -742,7 +742,7 b' infix/suffix resolution of ^ operator (i'
742 ('symbol', '4'))))
742 ('symbol', '4'))))
743 ('symbol', '2'))
743 ('symbol', '2'))
744 * set:
744 * set:
745 <spanset+ 0:2>
745 <spanset+ 0:3>
746 0
746 0
747 1
747 1
748 2
748 2
@@ -770,7 +770,7 b' infix/suffix resolution of ^ operator (i'
770 (parentpost
770 (parentpost
771 ('symbol', '9'))))))
771 ('symbol', '9'))))))
772 * set:
772 * set:
773 <spanset+ 4:9>
773 <spanset+ 4:10>
774 4
774 4
775 5
775 5
776 6
776 6
@@ -788,7 +788,7 b' infix/suffix resolution of ^ operator (i'
788 ('symbol', '1'))
788 ('symbol', '1'))
789 ('symbol', '2'))
789 ('symbol', '2'))
790 * set:
790 * set:
791 <spanset+ 0:2>
791 <spanset+ 0:3>
792 0
792 0
793 1
793 1
794 2
794 2
@@ -803,7 +803,7 b' infix/suffix resolution of ^ operator (i'
803 ('symbol', '1'))
803 ('symbol', '1'))
804 ('symbol', '2'))
804 ('symbol', '2'))
805 * set:
805 * set:
806 <spanset+ 0:2>
806 <spanset+ 0:3>
807 0
807 0
808 1
808 1
809 2
809 2
@@ -957,7 +957,7 b' test ancestors'
957 ('string', '\x08issue\\d+'))
957 ('string', '\x08issue\\d+'))
958 * set:
958 * set:
959 <filteredset
959 <filteredset
960 <fullreposet+ 0:9>,
960 <fullreposet+ 0:10>,
961 <grep '\x08issue\\d+'>>
961 <grep '\x08issue\\d+'>>
962 $ try 'grep(r"\bissue\d+")'
962 $ try 'grep(r"\bissue\d+")'
963 (func
963 (func
@@ -965,7 +965,7 b' test ancestors'
965 ('string', '\\bissue\\d+'))
965 ('string', '\\bissue\\d+'))
966 * set:
966 * set:
967 <filteredset
967 <filteredset
968 <fullreposet+ 0:9>,
968 <fullreposet+ 0:10>,
969 <grep '\\bissue\\d+'>>
969 <grep '\\bissue\\d+'>>
970 6
970 6
971 $ try 'grep(r"\")'
971 $ try 'grep(r"\")'
@@ -1023,18 +1023,18 b' Test order of first/last revisions'
1023 <filteredset
1023 <filteredset
1024 <baseset
1024 <baseset
1025 <limit n=3, offset=0,
1025 <limit n=3, offset=0,
1026 <spanset- 0:4>>>,
1026 <spanset- 0:5>>>,
1027 <spanset+ 3:9>>
1027 <spanset+ 3:10>>
1028 4
1028 4
1029 3
1029 3
1030
1030
1031 $ hg debugrevspec -s '3: & first(4:0, 3)'
1031 $ hg debugrevspec -s '3: & first(4:0, 3)'
1032 * set:
1032 * set:
1033 <filteredset
1033 <filteredset
1034 <spanset+ 3:9>,
1034 <spanset+ 3:10>,
1035 <baseset
1035 <baseset
1036 <limit n=3, offset=0,
1036 <limit n=3, offset=0,
1037 <spanset- 0:4>>>>
1037 <spanset- 0:5>>>>
1038 3
1038 3
1039 4
1039 4
1040
1040
@@ -1043,18 +1043,18 b' Test order of first/last revisions'
1043 <filteredset
1043 <filteredset
1044 <baseset
1044 <baseset
1045 <last n=3,
1045 <last n=3,
1046 <spanset+ 0:4>>>,
1046 <spanset+ 0:5>>>,
1047 <spanset+ 0:1>>
1047 <spanset+ 0:2>>
1048 1
1048 1
1049 0
1049 0
1050
1050
1051 $ hg debugrevspec -s ':1 & last(4:0, 3)'
1051 $ hg debugrevspec -s ':1 & last(4:0, 3)'
1052 * set:
1052 * set:
1053 <filteredset
1053 <filteredset
1054 <spanset+ 0:1>,
1054 <spanset+ 0:2>,
1055 <baseset
1055 <baseset
1056 <last n=3,
1056 <last n=3,
1057 <spanset+ 0:4>>>>
1057 <spanset+ 0:5>>>>
1058 0
1058 0
1059 1
1059 1
1060
1060
@@ -1550,10 +1550,10 b' ordering defined by it.'
1550 * set:
1550 * set:
1551 <filteredset
1551 <filteredset
1552 <filteredset
1552 <filteredset
1553 <spanset- 0:3>,
1553 <spanset- 0:4>,
1554 <spanset+ 0:3>>,
1554 <spanset+ 0:4>>,
1555 <not
1555 <not
1556 <spanset+ 1:2>>>
1556 <spanset+ 1:3>>>
1557 3
1557 3
1558 0
1558 0
1559
1559
@@ -1584,7 +1584,7 b' ordering defined by it.'
1584 define)
1584 define)
1585 * set:
1585 * set:
1586 <filteredset
1586 <filteredset
1587 <spanset- 0:2>,
1587 <spanset- 0:3>,
1588 <baseset [0, 1, 2]>>
1588 <baseset [0, 1, 2]>>
1589 2
1589 2
1590 1
1590 1
@@ -1621,10 +1621,10 b' ordering defined by it.'
1621 define)
1621 define)
1622 * set:
1622 * set:
1623 <filteredset
1623 <filteredset
1624 <spanset- 0:2>,
1624 <spanset- 0:3>,
1625 <addset
1625 <addset
1626 <baseset [2]>,
1626 <baseset [2]>,
1627 <spanset+ 0:1>>>
1627 <spanset+ 0:2>>>
1628 2
1628 2
1629 1
1629 1
1630 0
1630 0
@@ -1652,7 +1652,7 b' ordering defined by it.'
1652 define)
1652 define)
1653 * set:
1653 * set:
1654 <filteredset
1654 <filteredset
1655 <spanset- 0:2>,
1655 <spanset- 0:3>,
1656 <baseset+ [0, 1, 2]>>
1656 <baseset+ [0, 1, 2]>>
1657 2
1657 2
1658 1
1658 1
@@ -1680,7 +1680,7 b' ordering defined by it.'
1680 * set:
1680 * set:
1681 <filteredset
1681 <filteredset
1682 <baseset [0, 2, 1]>,
1682 <baseset [0, 2, 1]>,
1683 <spanset- 0:2>>
1683 <spanset- 0:3>>
1684 0
1684 0
1685 2
1685 2
1686 1
1686 1
@@ -1708,7 +1708,7 b' ordering defined by it.'
1708 define)
1708 define)
1709 * set:
1709 * set:
1710 <filteredset
1710 <filteredset
1711 <spanset- 0:2>,
1711 <spanset- 0:3>,
1712 <baseset [0, 1, 2]>>
1712 <baseset [0, 1, 2]>>
1713 2
1713 2
1714 1
1714 1
@@ -1756,7 +1756,7 b' ordering defined by it.'
1756 define)
1756 define)
1757 * set:
1757 * set:
1758 <filteredset
1758 <filteredset
1759 <spanset- 0:2>,
1759 <spanset- 0:3>,
1760 <not
1760 <not
1761 <baseset [0, 1]>>>
1761 <baseset [0, 1]>>>
1762 2
1762 2
@@ -1781,7 +1781,7 b' ordering defined by it.'
1781 define)
1781 define)
1782 * set:
1782 * set:
1783 <filteredset
1783 <filteredset
1784 <spanset- 0:2>,
1784 <spanset- 0:3>,
1785 <not
1785 <not
1786 <baseset [0, 1]>>>
1786 <baseset [0, 1]>>>
1787 2
1787 2
@@ -1832,7 +1832,7 b' ordering defined by it.'
1832 define)
1832 define)
1833 * set:
1833 * set:
1834 <filteredset
1834 <filteredset
1835 <spanset- 0:2>,
1835 <spanset- 0:3>,
1836 <baseset [0, 1, 2]>>
1836 <baseset [0, 1, 2]>>
1837 2
1837 2
1838 1
1838 1
@@ -1866,8 +1866,8 b' ordering defined by it.'
1866 define)
1866 define)
1867 * set:
1867 * set:
1868 <filteredset
1868 <filteredset
1869 <spanset+ 0:2>,
1869 <spanset+ 0:3>,
1870 <spanset+ 0:9>>
1870 <spanset+ 0:10>>
1871 0
1871 0
1872 1
1872 1
1873 2
1873 2
@@ -1905,8 +1905,8 b' ordering defined by it.'
1905 define)
1905 define)
1906 * set:
1906 * set:
1907 <filteredset
1907 <filteredset
1908 <spanset+ 0:2>,
1908 <spanset+ 0:3>,
1909 <spanset+ 0:9>>
1909 <spanset+ 0:10>>
1910 0
1910 0
1911 1
1911 1
1912 2
1912 2
@@ -1953,7 +1953,7 b' ordering defined by it.'
1953 <baseset
1953 <baseset
1954 <limit n=1, offset=0,
1954 <limit n=1, offset=0,
1955 <baseset [1, 0, 2]>>>,
1955 <baseset [1, 0, 2]>>>,
1956 <spanset- 0:2>>
1956 <spanset- 0:3>>
1957 1
1957 1
1958
1958
1959 $ try --optimize '2:0 & not last(0 + 2 + 1)'
1959 $ try --optimize '2:0 & not last(0 + 2 + 1)'
@@ -1985,7 +1985,7 b' ordering defined by it.'
1985 define)
1985 define)
1986 * set:
1986 * set:
1987 <filteredset
1987 <filteredset
1988 <spanset- 0:2>,
1988 <spanset- 0:3>,
1989 <not
1989 <not
1990 <baseset
1990 <baseset
1991 <last n=1,
1991 <last n=1,
@@ -2032,7 +2032,7 b' ordering defined by it.'
2032 define)
2032 define)
2033 * set:
2033 * set:
2034 <filteredset
2034 <filteredset
2035 <spanset- 0:2>,
2035 <spanset- 0:3>,
2036 <baseset [1]>>
2036 <baseset [1]>>
2037 1
2037 1
2038
2038
@@ -2133,11 +2133,11 b' ordering defined by it.'
2133 define)
2133 define)
2134 * set:
2134 * set:
2135 <filteredset
2135 <filteredset
2136 <spanset+ 0:2>,
2136 <spanset+ 0:3>,
2137 <addset
2137 <addset
2138 <baseset [2]>,
2138 <baseset [2]>,
2139 <filteredset
2139 <filteredset
2140 <fullreposet+ 0:9>,
2140 <fullreposet+ 0:10>,
2141 <contains 'a'>>>>
2141 <contains 'a'>>>>
2142 0
2142 0
2143 1
2143 1
@@ -2165,7 +2165,7 b' ordering defined by it.'
2165 * set:
2165 * set:
2166 <addset
2166 <addset
2167 <filteredset
2167 <filteredset
2168 <spanset- 0:2>,
2168 <spanset- 0:3>,
2169 <contains 'a'>>,
2169 <contains 'a'>>,
2170 <baseset [2]>>
2170 <baseset [2]>>
2171 1
2171 1
@@ -2590,7 +2590,7 b' test optimization of trivial `or` operat'
2590 * set:
2590 * set:
2591 <addset
2591 <addset
2592 <baseset [0, 1]>,
2592 <baseset [0, 1]>,
2593 <spanset+ 2:3>>
2593 <spanset+ 2:4>>
2594 0
2594 0
2595 1
2595 1
2596 2
2596 2
@@ -2628,10 +2628,10 b' test optimization of trivial `or` operat'
2628 * set:
2628 * set:
2629 <addset
2629 <addset
2630 <addset
2630 <addset
2631 <spanset+ 0:1>,
2631 <spanset+ 0:2>,
2632 <baseset [2]>>,
2632 <baseset [2]>>,
2633 <addset
2633 <addset
2634 <spanset+ 3:4>,
2634 <spanset+ 3:5>,
2635 <baseset [5, 6]>>>
2635 <baseset [5, 6]>>>
2636 0
2636 0
2637 1
2637 1
@@ -2746,13 +2746,13 b' test that chained `or` operations make b'
2746 * set:
2746 * set:
2747 <addset
2747 <addset
2748 <addset
2748 <addset
2749 <spanset+ 0:1>,
2749 <spanset+ 0:2>,
2750 <spanset+ 1:2>>,
2750 <spanset+ 1:3>>,
2751 <addset
2751 <addset
2752 <spanset+ 2:3>,
2752 <spanset+ 2:4>,
2753 <addset
2753 <addset
2754 <spanset+ 3:4>,
2754 <spanset+ 3:5>,
2755 <spanset+ 4:5>>>>
2755 <spanset+ 4:6>>>>
2756 0
2756 0
2757 1
2757 1
2758 2
2758 2
@@ -3169,7 +3169,7 b' aliases:'
3169 None)
3169 None)
3170 * set:
3170 * set:
3171 <filteredset
3171 <filteredset
3172 <fullreposet+ 0:9>,
3172 <fullreposet+ 0:10>,
3173 <merge>>
3173 <merge>>
3174 6
3174 6
3175
3175
@@ -3190,7 +3190,7 b' aliases:'
3190 None)
3190 None)
3191 * set:
3191 * set:
3192 <filteredset
3192 <filteredset
3193 <fullreposet+ 0:9>,
3193 <fullreposet+ 0:10>,
3194 <merge>>
3194 <merge>>
3195 6
3195 6
3196
3196
@@ -3248,7 +3248,7 b' test alias recursion'
3248 * set:
3248 * set:
3249 <addset+
3249 <addset+
3250 <filteredset
3250 <filteredset
3251 <fullreposet+ 0:9>,
3251 <fullreposet+ 0:10>,
3252 <merge>>,
3252 <merge>>,
3253 <generatorset+>>
3253 <generatorset+>>
3254 6
3254 6
@@ -3311,8 +3311,8 b' test nesting and variable passing'
3311 * set:
3311 * set:
3312 <baseset
3312 <baseset
3313 <max
3313 <max
3314 <fullreposet+ 0:9>,
3314 <fullreposet+ 0:10>,
3315 <spanset+ 2:5>>>
3315 <spanset+ 2:6>>>
3316 5
3316 5
3317
3317
3318 test chained `or` operations are flattened at parsing phase
3318 test chained `or` operations are flattened at parsing phase
@@ -3345,10 +3345,10 b' test chained `or` operations are flatten'
3345 ('symbol', '3'))))
3345 ('symbol', '3'))))
3346 * set:
3346 * set:
3347 <addset
3347 <addset
3348 <spanset+ 0:1>,
3348 <spanset+ 0:2>,
3349 <addset
3349 <addset
3350 <spanset+ 1:2>,
3350 <spanset+ 1:3>,
3351 <spanset+ 2:3>>>
3351 <spanset+ 2:4>>>
3352 0
3352 0
3353 1
3353 1
3354 2
3354 2
@@ -3393,7 +3393,7 b" but 'all()' should never be substituted "
3393 * set:
3393 * set:
3394 <filteredset
3394 <filteredset
3395 <baseset [0]>,
3395 <baseset [0]>,
3396 <spanset+ 0:9>>
3396 <spanset+ 0:10>>
3397 0
3397 0
3398
3398
3399 test unknown reference:
3399 test unknown reference:
@@ -3442,7 +3442,7 b' test unknown reference:'
3442 <addset
3442 <addset
3443 <baseset [9]>,
3443 <baseset [9]>,
3444 <filteredset
3444 <filteredset
3445 <fullreposet+ 0:9>,
3445 <fullreposet+ 0:10>,
3446 <desc '$1'>>>
3446 <desc '$1'>>>
3447 9
3447 9
3448
3448
@@ -3633,7 +3633,7 b' issue2549 - correct optimizations'
3633 <filteredset
3633 <filteredset
3634 <baseset
3634 <baseset
3635 <max
3635 <max
3636 <fullreposet+ 0:9>,
3636 <fullreposet+ 0:10>,
3637 <baseset [1, 2]>>>,
3637 <baseset [1, 2]>>>,
3638 <not
3638 <not
3639 <baseset [2]>>>
3639 <baseset [2]>>>
@@ -3651,7 +3651,7 b' issue2549 - correct optimizations'
3651 <filteredset
3651 <filteredset
3652 <baseset
3652 <baseset
3653 <min
3653 <min
3654 <fullreposet+ 0:9>,
3654 <fullreposet+ 0:10>,
3655 <baseset [1, 2]>>>,
3655 <baseset [1, 2]>>>,
3656 <not
3656 <not
3657 <baseset [1]>>>
3657 <baseset [1]>>>
General Comments 0
You need to be logged in to leave comments. Login now