revset: ensure we are reversing a list (
issue3530)
--- a/mercurial/revset.py Tue Jul 03 18:02:07 2012 +0200
+++ b/mercurial/revset.py Wed Jul 04 09:38:07 2012 -0700
@@ -1151,6 +1151,8 @@
Reverse order of set.
"""
l = getset(repo, subset, x)
+ if not isinstance(l, list):
+ l = list(l)
l.reverse()
return l
--- a/tests/test-revset.t Tue Jul 03 18:02:07 2012 +0200
+++ b/tests/test-revset.t Wed Jul 04 09:38:07 2012 -0700
@@ -372,6 +372,17 @@
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))'