tests: check that 'log --line-range' follows uncommitted changes stable
authorDenis Laxalde <denis@laxalde.org>
Fri, 29 Nov 2019 21:34:54 +0100
branchstable
changeset 43739 66d5c8c3afed
parent 43738 558f7585afcb
child 43740 d1b9d2c6ec96
tests: check that 'log --line-range' follows uncommitted changes The reason we start walking revisions from the working directory (None revision) in logcmdutil.getlinerangerevs() is because we can follow uncommitted changes. Adding a test to illustrate this based on an uncommitted rename as there was none before. This helps understand the fix in next changeset.
tests/test-log-linerange.t
--- a/tests/test-log-linerange.t	Fri Nov 29 18:49:59 2019 +0100
+++ b/tests/test-log-linerange.t	Fri Nov 29 21:34:54 2019 +0100
@@ -868,6 +868,38 @@
   +4
   
 
+Uncommitted changes with a rename
+
+  $ hg mv baz bazn
+  $ hg log -f -L bazn,5:7
+  changeset:   9:6af29c3a778f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo -> dir/baz; 1-1+
+  
+  changeset:   5:cfdf972b3971
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
+  
+  changeset:   4:eaec41c1a0c9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11 -> 11+; leading space before "1"
+  
+  changeset:   2:63a884426fd0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2 -> 2+; added bar
+  
+  changeset:   0:5ae1f82b9a00
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+  $ hg revert -a -C -q
+
 Binary files work but without diff hunks filtering.
 (Checking w/ and w/o diff.git option.)