revset: ensure we are reversing a list (
issue3530)
author |
Bryan O'Sullivan <bryano@fb.com> |
date |
Wed, 04 Jul 2012 09:38:07 -0700 |
parents |
1c55d1add24f |
children |
6bc275593d07 |
files |
mercurial/revset.py tests/test-revset.t |
diffstat |
2 files changed, 13 insertions(+), 0 deletions(-)
[+]
|
line diff
--- 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))'