changeset 30800:cd23879cbac7

revset: rename rev argument of followlines() to startrev The rev argument has the same meaning as startrev of follow(), and I think startrev is more informative. followlines() is new function, we can make BC now.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 09 Jan 2017 16:16:26 +0900
parents 0b49449a01f4
children 67ee7874e53b
files mercurial/revset.py tests/test-annotate.t
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Jan 13 23:48:21 2017 +0900
+++ b/mercurial/revset.py	Mon Jan 09 16:16:26 2017 +0900
@@ -1066,23 +1066,23 @@
     # of every revisions or files revisions.
     return _follow(repo, subset, x, '_followfirst', followfirst=True)
 
-@predicate('followlines(file, fromline, toline[, rev=.])', safe=True)
+@predicate('followlines(file, fromline, toline[, startrev=.])', safe=True)
 def followlines(repo, subset, x):
     """Changesets modifying `file` in line range ('fromline', 'toline').
 
-    Line range corresponds to 'file' content at 'rev' and should hence be
-    consistent with file size. If rev is not specified, working directory's
+    Line range corresponds to 'file' content at 'startrev' and should hence be
+    consistent with file size. If startrev is not specified, working directory's
     parent is used.
     """
     from . import context  # avoid circular import issues
 
-    args = getargsdict(x, 'followlines', 'file *lines rev')
+    args = getargsdict(x, 'followlines', 'file *lines startrev')
     if len(args['lines']) != 2:
         raise error.ParseError(_("followlines takes at least three arguments"))
 
     rev = '.'
-    if 'rev' in args:
-        revs = getset(repo, fullreposet(repo), args['rev'])
+    if 'startrev' in args:
+        revs = getset(repo, fullreposet(repo), args['startrev'])
         if len(revs) != 1:
             raise error.ParseError(
                 _("followlines expects exactly one revision"))
--- a/tests/test-annotate.t	Fri Jan 13 23:48:21 2017 +0900
+++ b/tests/test-annotate.t	Mon Jan 09 16:16:26 2017 +0900
@@ -490,11 +490,11 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, rev=20)'
+  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, startrev=20)'
   16: baz:0
   19: baz:3
   20: baz:4
-  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, rev=.^)'
+  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, startrev=.^)'
   16: baz:0
   19: baz:3
   $ printf "0\n0\n" | cat - baz > baz1
@@ -591,7 +591,7 @@
   $ hg log -r 'followlines(baz, 1)'
   hg: parse error: followlines takes at least three arguments
   [255]
-  $ hg log -r 'followlines(baz, 1, 2, rev=desc("b"))'
+  $ hg log -r 'followlines(baz, 1, 2, startrev=desc("b"))'
   hg: parse error: followlines expects exactly one revision
   [255]
   $ hg log -r 'followlines("glob:*", 1, 2)'