# HG changeset patch # User Joel Rosdahl # Date 2010-07-08 20:44:15 # Node ID efbc09fdefd8fd8480eb715b11f3b9bdafab598d # Parent e5aaaef91a27f8b6f8ff64b65b400fc74b8f5e7a test-log: Add test for "hg log -pf" (issue647) To test f786fc4b8764 we analyze this repo: 0 | 1 | 2 | 3 | 4 a ------------> b \ b -> dir/b -------> e d We follow dir/b and expects rev 0, 1 and 2. A log following b will surprisingly report rev 0 and 1. That's because the content and the parents are the same in rev 1 and rev 3, and the revlog entry from rev 1 is thus reused in rev 3 even though the revlink is incorrect. Note that if we follow e then we will get all revs, including rev 3, because b gets added to the set of interesting filenames we are following through all revisions. That might be surprising, but that's (currently) how it is. Original test case by Joel Rosdahl Original test reviewed by Nicolas Dumazet diff --git a/tests/test-log b/tests/test-log --- a/tests/test-log +++ b/tests/test-log @@ -31,6 +31,11 @@ hg log -vf a echo % many renames hg log -vf e +echo % log -pf dir/b +hg log -pf dir/b +echo % log -vf dir/b +hg log -vf dir/b + echo '% log copies with --copies' hg log -vC --template '{rev} {file_copies}\n' echo '% log copies switch without --copies, with old filecopy template' diff --git a/tests/test-log.out b/tests/test-log.out --- a/tests/test-log.out +++ b/tests/test-log.out @@ -76,6 +76,65 @@ description: a +% log -pf dir/b +changeset: 2:41dd4284081e +user: test +date: Thu Jan 01 00:00:03 1970 +0000 +summary: c + +diff -r 784de7cef101 -r 41dd4284081e dir/b +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/dir/b Thu Jan 01 00:00:03 1970 +0000 +@@ -0,0 +1,1 @@ ++a + +changeset: 1:784de7cef101 +user: test +date: Thu Jan 01 00:00:02 1970 +0000 +summary: b + +diff -r 8580ff50825a -r 784de7cef101 b +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/b Thu Jan 01 00:00:02 1970 +0000 +@@ -0,0 +1,1 @@ ++a + +changeset: 0:8580ff50825a +user: test +date: Thu Jan 01 00:00:01 1970 +0000 +summary: a + +diff -r 000000000000 -r 8580ff50825a a +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/a Thu Jan 01 00:00:01 1970 +0000 +@@ -0,0 +1,1 @@ ++a + +% log -vf dir/b +changeset: 2:41dd4284081e +user: test +date: Thu Jan 01 00:00:03 1970 +0000 +files: b dir/b +description: +c + + +changeset: 1:784de7cef101 +user: test +date: Thu Jan 01 00:00:02 1970 +0000 +files: b +description: +b + + +changeset: 0:8580ff50825a +user: test +date: Thu Jan 01 00:00:01 1970 +0000 +files: a +description: +a + + % log copies with --copies 4 e (dir/b) 3 b (a)