diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1151,6 +1151,8 @@ def reverse(repo, subset, x): Reverse order of set. """ l = getset(repo, subset, x) + if not isinstance(l, list): + l = list(l) l.reverse() return l diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -372,6 +372,17 @@ quoting needed 4 3 2 + $ log 'reverse(all())' + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 $ log 'rev(5)' 5 $ log 'sort(limit(reverse(all()), 3))'