# HG changeset patch # User Pierre-Yves David # Date 1459817154 25200 # Node ID 69c6e9623bdc6f7e790f93307502fbe5f8816789 # Parent 87b89dca669d52860db78d0ba04938570d776512 revset: force ascending order for baseset initialized from a set It is possible to initialize a baseset directly from a set object. However, in this case the iteration order was inherited from the set. Set have undefined iteration order (especially cpython and pypy will have different one) so we should not rely on it anywhere. Therefor we declare the baseset "ascending" to enforce a consistent iteration order. The sorting is done lazily by the baseset class and should have no performance impact when it does not matter. This makes test-revset.t pass with pypy. diff -r 87b89dca669d -r 69c6e9623bdc mercurial/revset.py --- a/mercurial/revset.py Mon Apr 04 17:45:15 2016 -0700 +++ b/mercurial/revset.py Mon Apr 04 17:45:54 2016 -0700 @@ -2798,13 +2798,15 @@ datarepr: a tuple of (format, obj, ...), a function or an object that provides a printable representation of the given data. """ + self._ascending = None if not isinstance(data, list): if isinstance(data, set): self._set = data + # set has no order we pick one for stability purpose + self._ascending = True data = list(data) self._list = data self._datarepr = datarepr - self._ascending = None @util.propertycache def _set(self):