[PATCH] tests: allow more flexibility in git diffstat output

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Dec 13 14:06:39 CST 2014



On 12/13/2014 07:40 AM, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare at gmail.com>
> # Date 1418460300 -3600
> #      Sam Dez 13 09:45:00 2014 +0100
> # Node ID eaf33fff7f2c31a5cc57b95898255221b0e3dc6f
> # Parent  495bc1b65d25872324a0220354f048b220304bd1
> tests: allow more flexibility in git diffstat output

Pushed to the clowncopter, thanks.

>
> The output of 'git diff --stat' changed in git 1.7.10 and 1.7.11.
> To ensure the tests work with earlier versions of git as well,
> the output is now wrapped with a whitespace regex.
>
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -767,18 +767,21 @@ add new changes, including whitespace
>     +++ b/s/foobar
>     @@ -1,4 +1,4 @@
>     -woopwoop
>     +woop    woop
>
>      foo
>      bar (no-eol)
>
> +execute a diffstat
> +the output contains a regex, because git 1.7.10 and 1.7.11
> + change the amount of whitespace
>     $ hg diff --subrepos --stat
> -  barfoo | 1 +
> -   foobar | 2 +-
> +  \s*barfoo |\s*1 + (re)
> +  \s*foobar |\s*2 +- (re)
>      2 files changed, 2 insertions(+), 1 deletion(-) (no-eol)
>
>   ensure adding include/exclude ignores the subrepo
>     $ hg diff --subrepos -I s/foobar
>     $ hg diff --subrepos -X s/foobar
>
>     $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list