# HG changeset patch # User Bryan O'Sullivan # Date 2012-07-04 16:38:07 # Node ID ee2370d866fc114835c7c6493aeebceddf9a77d6 # Parent 1c55d1add24f658464d7db78bc877beca00fa735 revset: ensure we are reversing a list (issue3530) 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))'