log: use rev() to build revset of --follow option from numeric revision stable
authorYuya Nishihara <yuya@tcha.org>
Sat, 10 Jan 2015 13:14:00 +0900
branchstable
changeset 23955 8a29897d42d2
parent 23954 310222feb9a8
child 23956 b1e026c25552
log: use rev() to build revset of --follow option from numeric revision startrev can be -1.
mercurial/cmdutil.py
tests/test-glog.t
--- a/mercurial/cmdutil.py	Sat Jan 10 12:56:38 2015 +0900
+++ b/mercurial/cmdutil.py	Sat Jan 10 13:14:00 2015 +0900
@@ -1781,7 +1781,8 @@
                 # manifest entry, so use match.files(), not pats.
                 opts[fpats[followfirst]] = list(match.files())
             else:
-                opts[fnopats[followdescendants][followfirst]] = str(startrev)
+                op = fnopats[followdescendants][followfirst]
+                opts[op] = 'rev(%d)' % startrev
         else:
             opts['_patslog'] = list(pats)
 
--- a/tests/test-glog.t	Sat Jan 10 12:56:38 2015 +0900
+++ b/tests/test-glog.t	Sat Jan 10 13:14:00 2015 +0900
@@ -1780,7 +1780,9 @@
   (group
     (func
       ('symbol', '_firstancestors')
-      ('symbol', '6')))
+      (func
+        ('symbol', 'rev')
+        ('symbol', '6'))))
 
 Cannot compare with log --follow-first FILE as it never worked
 
@@ -2187,7 +2189,9 @@
   (group
     (func
       ('symbol', 'descendants')
-      ('symbol', '6')))
+      (func
+        ('symbol', 'rev')
+        ('symbol', '6'))))
   --- log.nodes	* (glob)
   +++ glog.nodes	* (glob)
   @@ -1,3 +1,3 @@
@@ -2203,7 +2207,9 @@
   (group
     (func
       ('symbol', '_firstdescendants')
-      ('symbol', '6')))
+      (func
+        ('symbol', 'rev')
+        ('symbol', '6'))))
   --- log.nodes	* (glob)
   +++ glog.nodes	* (glob)
   @@ -1,3 +1,3 @@
@@ -2219,7 +2225,9 @@
   (group
     (func
       ('symbol', 'ancestors')
-      ('symbol', '6')))
+      (func
+        ('symbol', 'rev')
+        ('symbol', '6'))))
 
 Test --follow-first and backward --rev
 
@@ -2228,7 +2236,9 @@
   (group
     (func
       ('symbol', '_firstancestors')
-      ('symbol', '6')))
+      (func
+        ('symbol', 'rev')
+        ('symbol', '6'))))
 
 Test subdir