Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 28035:c65da6892ae5
tests: make chunk header of external diff glob-ed for portability
Before this patch, some tests using external "diff" command via
extdiff extension fail on Solaris, because system standard "diff" (=
/usr/bin/diff) on Solaris always formats chunk header in the style
below:
@@ -X.x +Y.y @@
even though "diff" on Linux sometimes omits ".x" and/or ".y" in it.
This patch makes chunk header of external diff glob-ed for portability
of tests, and adds check-code.py rules to detect such diff output in
tests.
This patch also changes "hg diff" output in test-subrepo-git to
simplify detection rules, even though it is certainly portable because
these lines are generated by "git" command.
This patch is a part of making tests using external "diff" portable,
and tests below aren't yet portable even after this patch.
test-largefiles-update.t
test-subrepo-deep-nested-change.t
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 08 Feb 2016 18:29:17 +0900 |
parents | e7ff258f71df |
children | 7e9e39228de6 |
line wrap: on
line diff
--- a/contrib/check-code.py Mon Feb 08 18:29:17 2016 +0900 +++ b/contrib/check-code.py Mon Feb 08 18:29:17 2016 +0900 @@ -180,6 +180,12 @@ "don't use (external) diff with -p for portability"), (r'^ [-+][-+][-+] .* [-+]0000 \(glob\)', "glob timezone field in diff output for portability"), + (r'^ @@ -[0-9]+ [+][0-9]+,[0-9]+ @@', + "use '@@ -N* +N,n @@ (glob)' style chunk header for portability"), + (r'^ @@ -[0-9]+,[0-9]+ [+][0-9]+ @@', + "use '@@ -N,n +N* @@ (glob)' style chunk header for portability"), + (r'^ @@ -[0-9]+ [+][0-9]+ @@', + "use '@@ -N* +N* @@ (glob)' style chunk header for portability"), ], # warnings [