Mercurial > public > mercurial-scm > hg
comparison mercurial/smartset.py @ 32817:e962c70c0aad
smartset: change repr of spanset to show revisions as half-open range
Before, an empty spanset was displayed as '<spanset+ 0:-1>', which seemed
confusing.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 11 Jun 2017 00:21:38 +0900 |
parents | 2cfdf5241096 |
children | 9ddb18ae342e |
comparison
equal
deleted
inserted
replaced
32816:1b25c648d5b7 | 32817:e962c70c0aad |
---|---|
1019 return None | 1019 return None |
1020 | 1020 |
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 |
1028 | 1028 |
1029 This class exists to host special optimization and magic to handle virtual | 1029 This class exists to host special optimization and magic to handle virtual |