# HG changeset patch # User Mathias De Maré # Date 1418587258 -3600 # Node ID 7651621507cf868170bd6f2c765958662f4a26f3 # Parent 7fa2189c1e87f1c6830c7841dacbc3fb61b3b545 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. diff -r 7fa2189c1e87 -r 7651621507cf tests/test-subrepo-git.t --- a/tests/test-subrepo-git.t Sun Dec 14 11:34:51 2014 +0100 +++ b/tests/test-subrepo-git.t Sun Dec 14 21:00:58 2014 +0100 @@ -778,7 +778,7 @@ $ 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