[PATCH V2] tests: avoid git diffstat singular/plural output difference

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Dec 14 15:55:18 CST 2014



On 12/14/2014 12:10 PM, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare at gmail.com>
> # Date 1418587258 -3600
> #      Son Dez 14 21:00:58 2014 +0100
> # Node ID 8ca2aa5000850fd114c30d34dc6248e57634c160
> # Parent  b1545533058401608b8e9eb4a6def860b56d3ca6
> tests: avoid git diffstat singular/plural output difference
>
> 'git diff --stat' output changed with regard to the amount
> of changes/insertions/deletions shown.
> In older git versions (1.7.7.6), output was shown as:
> 2 files changed, 2 insertions(+), 1 deletions(-)
> In newer versions, output is shown as:
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> This patch uses a regex to handle both cases.

Cool, this one is pushed to the clowncopter.

> 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
> @@ -773,23 +773,22 @@ add new changes, including whitespace
>      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
>     \s*barfoo |\s*1 + (re)
>     \s*foobar |\s*2 +- (re)
> -   2 files changed, 2 insertions(+), 1 deletion(-) (no-eol)
> +   2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) \(no-eol\) (re)
>
>   ensure adding include/exclude ignores the subrepo
>     $ hg diff --subrepos -I s/foobar
>     $ hg diff --subrepos -X s/foobar
>
> -

I've dropped this spurious dropped lines.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list