From patchwork Fri Jun 24 22:10:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5,of,5] revset: remove hacky sorting in fullreposet.__and__ From: via Mercurial-devel X-Patchwork-Id: 15611 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 24 Jun 2016 15:10:17 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1466804411 25200 # Fri Jun 24 14:40:11 2016 -0700 # Node ID abcf4b35dbdcee9a721b49ae2bb815a313baec57 # Parent 87950985ede58fc03fb4a207cd45f197f1690cb8 revset: remove hacky sorting in fullreposet.__and__ We don't seem to have any more functions depending on the sorting done in fullreposte.__and__, so let's remove it and open up for fixing other bugs caused by it. Specifically, it prevents rangeset() from doing "subset & r" as it should. diff -r 87950985ede5 -r abcf4b35dbdc mercurial/revset.py --- a/mercurial/revset.py Thu Jun 23 12:37:09 2016 -0700 +++ b/mercurial/revset.py Fri Jun 24 14:40:11 2016 -0700 @@ -3619,18 +3619,8 @@ # object. other = baseset(other - self._hiddenrevs) - # XXX As fullreposet is also used as bootstrap, this is wrong. - # - # With a giveme312() revset returning [3,1,2], this makes - # 'hg log -r "giveme312()"' -> 1, 2, 3 (wrong) - # We cannot just drop it because other usage still need to sort it: - # 'hg log -r "all() and giveme312()"' -> 1, 2, 3 (right) - # - # There is also some faulty revset implementations that rely on it - # (eg: children as of its state in e8075329c5fb) - # - # When we fix the two points above we can move this into the if clause - other.sort(reverse=self.isdescending()) + # As fullreposet is used as bootstrap, ignore its ordering and take + # that of other. return other def prettyformatset(revs): diff -r 87950985ede5 -r abcf4b35dbdc tests/test-revset.t --- a/tests/test-revset.t Thu Jun 23 12:37:09 2016 -0700 +++ b/tests/test-revset.t Fri Jun 24 14:40:11 2016 -0700 @@ -181,7 +181,7 @@ ('symbol', '3') ('symbol', '6')) * set: - + 3 5 6 @@ -1707,7 +1707,7 @@ ('symbol', '4'))) * set: , + , > 5 3 @@ -1730,7 +1730,7 @@ * set: , - > + > 0 1 2