# HG changeset patch # User Yuya Nishihara # Date 2017-06-10 15:21:38 # Node ID e962c70c0aadf1dcfbc5435e370da57eabca1987 # Parent 1b25c648d5b7d301fd08ef0bc492a82c6a07e191 smartset: change repr of spanset to show revisions as half-open range Before, an empty spanset was displayed as '', which seemed confusing. diff --git a/mercurial/smartset.py b/mercurial/smartset.py --- a/mercurial/smartset.py +++ b/mercurial/smartset.py @@ -1021,7 +1021,7 @@ class spanset(abstractsmartset): def __repr__(self): d = {False: '-', True: '+'}[self._ascending] return '<%s%s %d:%d>' % (type(self).__name__, d, - self._start, self._end - 1) + self._start, self._end) class fullreposet(spanset): """a set containing all revisions in the repo diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -157,7 +157,7 @@ trivial ('symbol', '0') ('symbol', '1')) * set: - + 0 1 $ try --optimize : @@ -168,7 +168,7 @@ trivial None define) * set: - + 0 1 2 @@ -266,7 +266,7 @@ names that should be caught by fallback (rangepost ('symbol', '+a+b+c+')) * set: - + 3 4 5 @@ -278,7 +278,7 @@ names that should be caught by fallback (rangepre ('symbol', '+a+b+c+')) * set: - + 0 1 2 @@ -288,7 +288,7 @@ names that should be caught by fallback ('symbol', '-a-b-c-') ('symbol', '+a+b+c+')) * set: - + 4 3 $ log '-a-b-c-:+a+b+c+' @@ -626,7 +626,7 @@ may be hidden (issue5385) None define) * set: - + 0 1 2 @@ -643,7 +643,7 @@ may be hidden (issue5385) ('symbol', '1') define) * set: - + 0 1 $ try -p analyzed ':(1|2)' @@ -656,7 +656,7 @@ may be hidden (issue5385) define) define) * set: - + 0 1 2 @@ -681,7 +681,7 @@ infix/suffix resolution of ^ operator (i ('symbol', '1')) ('symbol', '2')) * set: - + 0 1 2 @@ -702,7 +702,7 @@ infix/suffix resolution of ^ operator (i (parentpost ('symbol', '9'))) * set: - + 8 9 @@ -727,7 +727,7 @@ infix/suffix resolution of ^ operator (i ('symbol', '1')) ('symbol', '2'))) * set: - + 0 1 2 @@ -742,7 +742,7 @@ infix/suffix resolution of ^ operator (i ('symbol', '4')))) ('symbol', '2')) * set: - + 0 1 2 @@ -770,7 +770,7 @@ infix/suffix resolution of ^ operator (i (parentpost ('symbol', '9')))))) * set: - + 4 5 6 @@ -788,7 +788,7 @@ infix/suffix resolution of ^ operator (i ('symbol', '1')) ('symbol', '2')) * set: - + 0 1 2 @@ -803,7 +803,7 @@ infix/suffix resolution of ^ operator (i ('symbol', '1')) ('symbol', '2')) * set: - + 0 1 2 @@ -957,7 +957,7 @@ test ancestors ('string', '\x08issue\\d+')) * set: , + , > $ try 'grep(r"\bissue\d+")' (func @@ -965,7 +965,7 @@ test ancestors ('string', '\\bissue\\d+')) * set: , + , > 6 $ try 'grep(r"\")' @@ -1023,18 +1023,18 @@ Test order of first/last revisions >>, - > + >>, + > 4 3 $ hg debugrevspec -s '3: & first(4:0, 3)' * set: , + , >>> + >>> 3 4 @@ -1043,18 +1043,18 @@ Test order of first/last revisions >>, - > + >>, + > 1 0 $ hg debugrevspec -s ':1 & last(4:0, 3)' * set: , + , >>> + >>> 0 1 @@ -1550,10 +1550,10 @@ ordering defined by it. * set: , - >, + , + >, >> + >> 3 0 @@ -1584,7 +1584,7 @@ ordering defined by it. define) * set: , + , > 2 1 @@ -1621,10 +1621,10 @@ ordering defined by it. define) * set: , + , , - >> + >> 2 1 0 @@ -1652,7 +1652,7 @@ ordering defined by it. define) * set: , + , > 2 1 @@ -1680,7 +1680,7 @@ ordering defined by it. * set: , - > + > 0 2 1 @@ -1708,7 +1708,7 @@ ordering defined by it. define) * set: , + , > 2 1 @@ -1756,7 +1756,7 @@ ordering defined by it. define) * set: , + , >> 2 @@ -1781,7 +1781,7 @@ ordering defined by it. define) * set: , + , >> 2 @@ -1832,7 +1832,7 @@ ordering defined by it. define) * set: , + , > 2 1 @@ -1866,8 +1866,8 @@ ordering defined by it. define) * set: , - > + , + > 0 1 2 @@ -1905,8 +1905,8 @@ ordering defined by it. define) * set: , - > + , + > 0 1 2 @@ -1953,7 +1953,7 @@ ordering defined by it. >>, - > + > 1 $ try --optimize '2:0 & not last(0 + 2 + 1)' @@ -1985,7 +1985,7 @@ ordering defined by it. define) * set: , + , , + , > 1 @@ -2133,11 +2133,11 @@ ordering defined by it. define) * set: , + , , , + , >>> 0 1 @@ -2165,7 +2165,7 @@ ordering defined by it. * set: , + , >, > 1 @@ -2590,7 +2590,7 @@ test optimization of trivial `or` operat * set: , - > + > 0 1 2 @@ -2628,10 +2628,10 @@ test optimization of trivial `or` operat * set: , + , >, , + , >> 0 1 @@ -2746,13 +2746,13 @@ test that chained `or` operations make b * set: , - >, + , + >, , + , , - >>> + , + >>> 0 1 2 @@ -3169,7 +3169,7 @@ aliases: None) * set: , + , > 6 @@ -3190,7 +3190,7 @@ aliases: None) * set: , + , > 6 @@ -3248,7 +3248,7 @@ test alias recursion * set: , + , >, > 6 @@ -3311,8 +3311,8 @@ test nesting and variable passing * set: , - >> + , + >> 5 test chained `or` operations are flattened at parsing phase @@ -3345,10 +3345,10 @@ test chained `or` operations are flatten ('symbol', '3')))) * set: , + , , - >> + , + >> 0 1 2 @@ -3393,7 +3393,7 @@ but 'all()' should never be substituted * set: , - > + > 0 test unknown reference: @@ -3442,7 +3442,7 @@ test unknown reference: , , + , >> 9 @@ -3633,7 +3633,7 @@ issue2549 - correct optimizations , + , >>, >> @@ -3651,7 +3651,7 @@ issue2549 - correct optimizations , + , >>, >>