[PATCH 2 of 2] tests: test "hg log" with --line-range and --copies

Denis Laxalde denis at laxalde.org
Thu Nov 14 05:42:41 EST 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1573727585 -3600
#      Thu Nov 14 11:33:05 2019 +0100
# Node ID a0b29e94b386346d61e1549d5b8e47bec51b0783
# Parent  3386a6737e04d6a8cf4787f8a76765dcea5857de
tests: test "hg log" with --line-range and --copies

This now works (does not crash), due to previous changeset. Since
--line-range implies --follow, --copies option is redundant.

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,112 @@ Renames are followed.
   +4
   
 
+Copies.
+
+  $ hg copy baz bbaz
+  $ sed 's/6/6+/' bbaz > bbaz.new
+  $ mv bbaz.new bbaz
+  $ hg commit -m 'cp baz bbaz; 6-6+'
+  $ hg diff -c .
+  diff --git a/dir/baz b/dir/bbaz
+  copy from dir/baz
+  copy to dir/bbaz
+  --- a/dir/baz
+  +++ b/dir/bbaz
+  @@ -7,7 +7,7 @@
+   3+
+   4
+   5
+  -6
+  +6+
+   7
+   8
+   9
+  $ hg log --copies -f -L bbaz,10:11 -p
+  changeset:   10:91a3d3b6c546
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     cp baz bbaz; 6-6+
+  
+  diff --git a/dir/baz b/dir/bbaz
+  copy from dir/baz
+  copy to dir/bbaz
+  --- a/dir/baz
+  +++ b/dir/bbaz
+  @@ -7,7 +7,7 @@
+   3+
+   4
+   5
+  -6
+  +6+
+   7
+   8
+   9
+  
+  changeset:   3:730a61fbaecf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     to 11
+  
+  diff --git a/foo b/foo
+  --- a/foo
+  +++ b/foo
+  @@ -6,3 +6,10 @@
+   2+
+   3
+   4
+  +5
+  +6
+  +7
+  +8
+  +9
+  +10
+  +11
+  
+  $ hg log -f -L bbaz,10:11 -p
+  changeset:   10:91a3d3b6c546
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     cp baz bbaz; 6-6+
+  
+  diff --git a/dir/baz b/dir/bbaz
+  copy from dir/baz
+  copy to dir/bbaz
+  --- a/dir/baz
+  +++ b/dir/bbaz
+  @@ -7,7 +7,7 @@
+   3+
+   4
+   5
+  -6
+  +6+
+   7
+   8
+   9
+  
+  changeset:   3:730a61fbaecf
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     to 11
+  
+  diff --git a/foo b/foo
+  --- a/foo
+  +++ b/foo
+  @@ -6,3 +6,10 @@
+   2+
+   3
+   4
+  +5
+  +6
+  +7
+  +8
+  +9
+  +10
+  +11
+  
+
 Binary files work but without diff hunks filtering.
 (Checking w/ and w/o diff.git option.)
 
@@ -875,7 +981,7 @@ Binary files work but without diff hunks
   $ hg add binary
   $ hg ci -m 'add a binary file' --quiet
   $ hg log -f -L binary,1:2 -p
-  changeset:   10:c96381c229df
+  changeset:   11:dc865b608edf
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -890,13 +996,13 @@ Binary files work but without diff hunks
   
   
   $ hg log -f -L binary,1:2 -p --config diff.git=false
-  changeset:   10:c96381c229df
+  changeset:   11:dc865b608edf
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add a binary file
   
-  diff -r 6af29c3a778f -r c96381c229df dir/binary
+  diff -r 91a3d3b6c546 -r dc865b608edf dir/binary
   Binary file dir/binary has changed
   
 


More information about the Mercurial-devel mailing list