diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2283,12 +2283,7 @@ class abstractsmartset(object): """Returns a new object with the union of the two collections. This is part of the mandatory API for smartset.""" - kwargs = {} - if self.isascending() and other.isascending(): - kwargs['ascending'] = True - if self.isdescending() and other.isdescending(): - kwargs['ascending'] = False - return addset(self, other, **kwargs) + return addset(self, other) def __sub__(self, other): """Returns a new object with the substraction of the two collections. diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -572,6 +572,29 @@ test intersecting something with an adds 5 8 +test that `or` operation combines elements in the right order: + + $ log '3:4 or 2:5' + 3 + 4 + 2 + 5 + $ log '3:4 or 5:2' + 3 + 4 + 5 + 2 + $ log 'sort(3:4 or 2:5)' + 2 + 3 + 4 + 5 + $ log 'sort(3:4 or 5:2)' + 2 + 3 + 4 + 5 + check that conversion to only works $ try --optimize '::3 - ::1' (minus