Patchwork [1,of,2,stable,v2] tests: test coverage of tricky case where diffs show wrong copy information

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 11, 2014, 8:27 p.m.
Message ID <837f7c70551db57aef3a.1418329627@ssl.google-analytics.com>
Download mbox | patch
Permalink /patch/7053/
State Changes Requested
Delegated to: Pierre-Yves David
Headers show

Comments

Mads Kiilerich - Dec. 11, 2014, 8:27 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1418329265 -3600
#      Thu Dec 11 21:21:05 2014 +0100
# Branch stable
# Node ID 837f7c70551db57aef3a80dac4b50129bb647529
# Parent  424d669118d323ca1aeb309f2a8a4631f69d1fe3
tests: test coverage of tricky case where diffs show wrong copy information

This shows pretty much the same issue as addressed in 652ab726ba93, indicating
that the fix there is insufficient, just as 243ea5ffdf31 was. In this new case
we can blame it on linkrev and how it is used to apply the limit.

Patch

diff --git a/tests/test-mv-cp-st-diff.t b/tests/test-mv-cp-st-diff.t
--- a/tests/test-mv-cp-st-diff.t
+++ b/tests/test-mv-cp-st-diff.t
@@ -1605,3 +1605,57 @@ 
   -
   +f
   $ cd ..
+
+another test showing that we have to look further back:
+
+  $ hg init diffstoplinkrev
+  $ cd diffstoplinkrev
+
+  $ touch f
+  $ hg ci -Aqm 'empty f'
+
+  $ echo change > f
+  $ hg ci -m 'change f'
+  $ hg tag -l change
+
+  $ hg up -qr 0
+
+  $ hg branch -q dev
+  $ hg ci -Aqm dev
+  $ hg tag -l dev-start
+
+  $ hg mv f renamed
+  $ hg ci -m renamed
+  $ hg tag -l renamed
+
+  $ hg up -qr dev-start
+
+  $ hg graft -q change
+
+  $ hg merge -q renamed
+  $ hg ci -m 'merge'
+
+  $ hg log -G -T '{rev} {desc}'
+  @    5 merge
+  |\
+  | o  4 change f
+  | |
+  o |  3 renamed
+  |/
+  o  2 dev
+  |
+  | o  1 change f
+  |/
+  o  0 empty f
+  
+  $ hg diff --git -r dev-start -r dev
+  diff --git a/f b/f
+  deleted file mode 100644
+  diff --git a/renamed b/renamed
+  new file mode 100644
+  --- /dev/null
+  +++ b/renamed
+  @@ -0,0 +1,1 @@
+  +change
+
+  $ cd ..