[PATCH stable] test-log: Add test for "hg log -pf" (issue647)

Nicolas Dumazet nicdumz at gmail.com
Tue Jul 13 07:29:38 CDT 2010


On Sat, 10 Jul 2010 12:31:33 +0200
Mads Kiilerich <mads at kiilerich.com> wrote:

> # HG changeset patch
> # User Joel Rosdahl <joel at rosdahl.net>
> # Date 1278621855 -7200
> # Node ID 8308e4ad39813f6d0dd1987ac9628003f5e2ccb4
> # Parent  f4eddec324b755a45ea71570c7c8dc63bcbdfc1a
> test-log: Add test for "hg log -pf" (issue647)
> 
> Test for f786fc4b8764
> 
> diff --git a/tests/test-log b/tests/test-log
> --- a/tests/test-log
> +++ b/tests/test-log
> @@ -31,6 +31,9 @@
>  echo % many renames
>  hg log -vf e
>  
> +echo % log -pf b
> +hg log -pf 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,29 @@
>  a
>  
>  
> +% log -pf b
> +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
> +

Mmm... that looks strange to me.

The test builds:

0 | 1 |   2    | 3  |   4
a  ------------> b
 \
    b -> dir/b -------> e

                 d

(a copied to b in rev1; b renamed to dir/b in rev2; etc...)


Why would "log -pf b" return [0,1] ? I would expect [0,3]

Other strange finding: here, "log -vf b" gives: [0,1,0,1,2].
(yes! 0 and 1 are returned twice! Ugh!) Again, I'd expect [0,3]

Or do I understand the -f parameter wrongly?

-Nicolas.

>  % log copies with --copies
>  4 e (dir/b)
>  3 b (a)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list