Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 23827:4982fade9733
revset: simplify fullreposet.__and__ to call sort() with boolean flag
Note that sort() takes a boolean flag, so other.sort(reverse) was wrong.
It just worked fine because there is a top-level function, reverse().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 10 Jan 2015 21:36:42 +0900 |
parents | 02f4560b69b7 |
children | 9b1d3bac61a7 |
comparison
equal
deleted
inserted
replaced
23825:b2358bc1407c | 23827:4982fade9733 |
---|---|
3100 # | 3100 # |
3101 # `other` was used with "&", let's assume this is a set like | 3101 # `other` was used with "&", let's assume this is a set like |
3102 # object. | 3102 # object. |
3103 other = baseset(other - self._hiddenrevs) | 3103 other = baseset(other - self._hiddenrevs) |
3104 | 3104 |
3105 if self.isascending(): | 3105 other.sort(reverse=self.isdescending()) |
3106 other.sort() | |
3107 else: | |
3108 other.sort(reverse) | |
3109 return other | 3106 return other |
3110 | 3107 |
3111 # tell hggettext to extract docstrings from these functions: | 3108 # tell hggettext to extract docstrings from these functions: |
3112 i18nfunctions = symbols.values() | 3109 i18nfunctions = symbols.values() |