changeset 17676:f87683a1b02a

clfilter: remove any explicit revision number from default cmdutil range Revision "0" and "-1" may be filtered, we can't use them in any default revrange.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 03 Sep 2012 14:29:05 +0200
parents 8575f4a2126e
children 5c89e7fa5bc2
files mercurial/cmdutil.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu Sep 20 19:01:53 2012 +0200
+++ b/mercurial/cmdutil.py	Mon Sep 03 14:29:05 2012 +0200
@@ -999,12 +999,13 @@
 
     if not len(repo):
         return []
-
-    if follow:
-        defrange = '%s:0' % repo['.'].rev()
+    if opts.get('rev'):
+        revs = scmutil.revrange(repo, opts.get('rev'))
+    elif follow:
+        revs = repo.revs('reverse(:.)')
     else:
-        defrange = '-1:0'
-    revs = scmutil.revrange(repo, opts.get('rev') or [defrange])
+        revs = list(repo)
+        revs.reverse()
     if not revs:
         return []
     wanted = set()
@@ -1392,7 +1393,7 @@
         revs = scmutil.revrange(repo, opts['rev'])
     else:
         if follow and len(repo) > 0:
-            revs = scmutil.revrange(repo, ['.:0'])
+            revs = repo.revs('reverse(:.)')
         else:
             revs = list(repo.changelog)
             revs.reverse()