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: <baseset [0]> - 1: <baseset [0]> - -1: <baseset []> + 0: <baseset+ [0]> + 1: <baseset+ [0]> + -1: <baseset+ []> 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: <baseset [0]> - 1: <baseset [1]> - -1: <baseset [-1]> + 0: <baseset+ [0]> + 1: <baseset+ [1]> + -1: <baseset+ [-1]> out-of-range roots are ignored: - 2: <baseset []> - 10000: <baseset []> - -2: <baseset []> - -10000: <baseset []> + 2: <baseset+ []> + 10000: <baseset+ []> + -2: <baseset+ []> + -10000: <baseset+ []> 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: - <baseset [3, 5, 6]> + <baseset+ [3, 5, 6]> 3 5 6 @@ -991,7 +991,7 @@ test that `or` operation skips duplicate ('symbol', '4'))) * set: <addset - <baseset [5, 3, 1]>, + <baseset- [1, 3, 5]>, <generatorset+>> 5 3 @@ -1014,7 +1014,7 @@ test that `or` operation skips duplicate * set: <addset+ <generatorset+>, - <baseset [5, 3, 1]>> + <baseset- [1, 3, 5]>> 0 1 2