Patchwork [1,of,2,STABLE] tests: check that 'log --line-range' follows uncommitted changes

login
register
mail settings
Submitter Denis Laxalde
Date Nov. 29, 2019, 8:59 p.m.
Message ID <969e8a52e3842d19387d.1575061158@marimba>
Download mbox | patch
Permalink /patch/43541/
State New
Headers show

Comments

Denis Laxalde - Nov. 29, 2019, 8:59 p.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1575059694 -3600
#      Fri Nov 29 21:34:54 2019 +0100
# Branch stable
# Node ID 969e8a52e3842d19387d02e91d6a19a993950ac0
# Parent  371765e775a2cb4c4b41eed10dbee0ceee8ab1f9
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.

Patch

diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t
--- a/tests/test-log-linerange.t
+++ b/tests/test-log-linerange.t
@@ -868,6 +868,38 @@  Renames are followed.
   +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.)