# HG changeset patch # User Pierre-Yves David # Date 2016-04-05 00:45:15 # Node ID 87b89dca669d52860db78d0ba04938570d776512 # Parent 09750b1231c271e45fa527f1bd4e562f7b2e9f91 revset: stabilize repr of baseset initialized with a set Cpython and pypy have different way to build and order set, so the result of list(myset) is different. We work around this by using the sorted version of the data when displaying a list. This get pypy closer to pass test-revset.t. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2889,7 +2889,13 @@ class baseset(abstractsmartset): d = {None: '', False: '-', True: '+'}[self._ascending] s = _formatsetrepr(self._datarepr) if not s: - s = repr(self._list) + l = self._list + # if _list has been built from a set, it might have a different + # order from one python implementation to another. + # We fallback to the sorted version for a stable output. + if self._ascending is not None: + l = self._asclist + s = repr(l) return '<%s%s %s>' % (type(self).__name__, d, s) class filteredset(abstractsmartset): diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -725,7 +725,7 @@ Test opreand of '%' is optimized recursi ('symbol', '9') ('symbol', '5'))) * set: - + 2 4 8