# HG changeset patch # User Pierre-Yves David # Date 2015-08-21 00:23:21 # 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 --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -186,8 +186,10 @@ class changelog(revlog.revlog): 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 --git a/tests/test-parseindex.t b/tests/test-parseindex.t --- a/tests/test-parseindex.t +++ b/tests/test-parseindex.t @@ -96,9 +96,9 @@ Test SEGV caused by bad revision passed > 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 @@ Test SEGV caused by bad revision passed -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 --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -141,7 +141,7 @@ trivial ('symbol', '3') ('symbol', '6')) * set: - + 3 5 6 @@ -991,7 +991,7 @@ test that `or` operation skips duplicate ('symbol', '4'))) * set: , + , > 5 3 @@ -1014,7 +1014,7 @@ test that `or` operation skips duplicate * set: , - > + > 0 1 2