# HG changeset patch # User Pierre-Yves David # Date 1440116601 25200 # Node ID be8a4e0800d8be3b40242d5f21638eeccd88ea59 # Parent 4ee2af2194d4d34c61fb5649df1da445905df160 reachableroots: use baseset lazy sorting smartset sorting is lazy (so faster in some case) and better (informs that the set is sorted allowing some optimisation). So we rely on it directly. Some test output are updated because we now have more information (ordering). diff -r 4ee2af2194d4 -r be8a4e0800d8 mercurial/changelog.py --- a/mercurial/changelog.py Thu Aug 20 17:19:56 2015 -0700 +++ b/mercurial/changelog.py Thu Aug 20 17:23:21 2015 -0700 @@ -186,8 +186,10 @@ return self._nodecache def reachableroots(self, minroot, heads, roots, includepath=False): - return revset.baseset(sorted( - self.index.reachableroots2(minroot, heads, roots, includepath))) + rroots = self.index.reachableroots2(minroot, heads, roots, includepath) + rroots = revset.baseset(rroots) + rroots.sort() + return rroots def headrevs(self): if self.filteredrevs: diff -r 4ee2af2194d4 -r be8a4e0800d8 tests/test-parseindex.t --- a/tests/test-parseindex.t Thu Aug 20 17:19:56 2015 -0700 +++ b/tests/test-parseindex.t Thu Aug 20 17:23:21 2015 -0700 @@ -96,9 +96,9 @@ > print inst > EOF good heads: - 0: - 1: - -1: + 0: + 1: + -1: bad heads: 2: head out of range 10000: head out of range @@ -106,14 +106,14 @@ -10000: head out of range None: an integer is required good roots: - 0: - 1: - -1: + 0: + 1: + -1: out-of-range roots are ignored: - 2: - 10000: - -2: - -10000: + 2: + 10000: + -2: + -10000: bad roots: None: an integer is required diff -r 4ee2af2194d4 -r be8a4e0800d8 tests/test-revset.t --- a/tests/test-revset.t Thu Aug 20 17:19:56 2015 -0700 +++ b/tests/test-revset.t Thu Aug 20 17:23:21 2015 -0700 @@ -141,7 +141,7 @@ ('symbol', '3') ('symbol', '6')) * set: - + 3 5 6 @@ -991,7 +991,7 @@ ('symbol', '4'))) * set: , + , > 5 3 @@ -1014,7 +1014,7 @@ * set: , - > + > 0 1 2