Patchwork [2,of,2] tests: test-check-code-hg.t works for all files to check

login
register
mail settings
Submitter Simon Heimberg
Date July 13, 2013, 7:10 p.m.
Message ID <3e74d069e4503093d42a.1373742616@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1870/
State Superseded, archived
Headers show

Comments

Simon Heimberg - July 13, 2013, 7:10 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1373742278 -7200
# Node ID 3e74d069e4503093d42afbb7cca0467520a0faee
# Parent  089daf84e6c4088633c39290142694000af25f37
tests: test-check-code-hg.t works for all files to check

with xargs, backslashes are eaten up. Convert them to slashes therefore.
This is only a problem with ls (on windows). hg manifest returns slashes.
Simon Heimberg - July 15, 2013, 6:31 a.m.
Simon Heimberg <simohe <at> besonet.ch> writes:

> 
> # HG changeset patch
> # User Simon Heimberg <simohe <at> besonet.ch>
> # Date 1373742278 -7200
> # Node ID 3e74d069e4503093d42afbb7cca0467520a0faee
> # Parent  089daf84e6c4088633c39290142694000af25f37
> tests: test-check-code-hg.t works for all files to check
> 
> with xargs, backslashes are eaten up. Convert them to slashes therefore.
> This is only a problem with ls (on windows). hg manifest returns slashes.
> 
> diff -r 089daf84e6c4 -r 3e74d069e450 tests/test-check-code-hg.t
> --- a/tests/test-check-code-hg.t	Sam Jul 13 20:46:57 2013 +0200
> +++ b/tests/test-check-code-hg.t	Sam Jul 13 21:04:38 2013 +0200
>  <at>  <at>  -26,6 +26,6  <at>  <at> 
> 
>  New errors are not allowed. Warnings are strongly discouraged.
> 
> -  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py; } \
> +  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py | sed 's-\\-/-g'; } \
>    >   | xargs "$check_code" --warnings --per-file=0 \
>    >   || false
> 

using "sed s" results in a check-code error: "use regex test output patterns 
instead of sed"
(from this line: 
http://hg.intevation.org/mercurial/crew/file/3af3a165db18/contrib/check-
code.py#l114)
Moving the pipe char one line up should help. I have manually rewritten the 
patch below. I can test and resend it properly later (when at a different 
computer).


# HG changeset patch
# User Simon Heimberg <simohe <at> besonet.ch>
# Node ID 3e74d069e4503093d42afbb7cca0467520a0faee
# Parent  089daf84e6c4088633c39290142694000af25f37
tests: test-check-code-hg.t works for all files to check

with xargs, backslashes are eaten up. Convert them to slashes therefore.
This is only a problem with ls (on windows). hg manifest returns slashes.

diff -r 089daf84e6c4 -r 3e74d069e450 tests/test-check-code-hg.t
--- a/tests/test-check-code-hg.t	Sam Jul 13 20:46:57 2013 +0200
+++ b/tests/test-check-code-hg.t	Sam Jul 13 21:04:38 2013 +0200
 <at>  <at>  -26,6 +26,6  <at>  <at> 

 New errors are not allowed. Warnings are strongly discouraged.

-  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py; } \
-  >   | xargs "$check_code" --warnings --per-file=0 \
+  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py | sed 's-\\-/-g'; } |
+  >   xargs "$check_code" --warnings --per-file=0 \
   >   || false

Patch

diff -r 089daf84e6c4 -r 3e74d069e450 tests/test-check-code-hg.t
--- a/tests/test-check-code-hg.t	Sam Jul 13 20:46:57 2013 +0200
+++ b/tests/test-check-code-hg.t	Sam Jul 13 21:04:38 2013 +0200
@@ -26,6 +26,6 @@ 
 
 New errors are not allowed. Warnings are strongly discouraged.
 
-  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py; } \
+  $ { hg manifest 2>/dev/null; ls "$TESTTMP"/*.py | sed 's-\\-/-g'; } \
   >   | xargs "$check_code" --warnings --per-file=0 \
   >   || false