test-log: Add test for "hg log -pf" (issue647) stable
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 08 Jul 2010 22:44:15 +0200
branchstable
changeset 11562 efbc09fdefd8
parent 11561 e5aaaef91a27
child 11563 cd6884231db8
child 11571 636554d58665
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 <joel@rosdahl.net> Original test reviewed by Nicolas Dumazet <nicdumz@gmail.com>
tests/test-log
tests/test-log.out
--- a/tests/test-log	Wed Jul 14 11:02:20 2010 -0400
+++ b/tests/test-log	Thu Jul 08 22:44:15 2010 +0200
@@ -31,6 +31,11 @@
 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'
--- a/tests/test-log.out	Wed Jul 14 11:02:20 2010 -0400
+++ b/tests/test-log.out	Thu Jul 08 22:44:15 2010 +0200
@@ -76,6 +76,65 @@
 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)