diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -156,9 +156,10 @@ def andset(repo, subset, x, y): return getset(repo, getset(repo, subset, x), y) def orset(repo, subset, x, y): - s = set(getset(repo, subset, x)) - s |= set(getset(repo, [r for r in subset if r not in s], y)) - return [r for r in subset if r in s] + xl = getset(repo, subset, x) + s = set(xl) + yl = getset(repo, [r for r in subset if r not in s], y) + return xl + yl def notset(repo, subset, x): s = set(getset(repo, subset, x)) diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -369,3 +369,8 @@ issue2654: report a parse error if the r hg: parse error at 2: invalid token [255] +or operator should preserve ordering: + $ log 'reverse(2::4) or tip' + 4 + 2 + 9