diff tests/test-annotate.t @ 41562:1c04894e8fe1

revset: allow to parse single integer as a range Even though this wouldn't be any useful in followlines(), it helps to unify range processing.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 27 Jan 2019 13:28:45 +0900
parents b6673e9bdcf6
children 151cc149b17f
line wrap: on
line diff
--- a/tests/test-annotate.t	Sun Jan 27 13:18:53 2019 +0900
+++ b/tests/test-annotate.t	Sun Jan 27 13:28:45 2019 +0900
@@ -809,6 +809,15 @@
   |\
   ~ ~
 
+An integer as a line range, which is parsed as '1:1'
+
+  $ hg log -r 'followlines(baz, 1)'
+  changeset:   22:2174d0bf352a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added two lines with 0
+  
+
 check error cases
   $ hg up 24 --quiet
   $ hg log -r 'followlines()'
@@ -817,8 +826,8 @@
   $ hg log -r 'followlines(baz)'
   hg: parse error: followlines requires a line range
   [255]
-  $ hg log -r 'followlines(baz, 1)'
-  hg: parse error: followlines expects a line range
+  $ hg log -r 'followlines(baz, x)'
+  hg: parse error: followlines expects a line number or a range
   [255]
   $ hg log -r 'followlines(baz, 1:2, startrev=desc("b"))'
   hg: parse error: followlines expects exactly one revision