[PATCH] keyword: cleanup test and make it portable

Mads Kiilerich mads at kiilerich.com
Sat May 1 14:22:12 CDT 2010


>
> # HG changeset patch
> # User Christian Ebert<blacktrash at gmx.net>
> # Date 1272739780 -7200
> # Node ID c8bf0fbd4456b9ba9cc2b642124e9c0cda50d150
> # Parent  f6dcbeb5babe7278531e127b91c55f2d94a0c8b9
> keyword: cleanup test and make it portable
>
> - replace sed call with python command
> - no need to back up hgrc before record
>
> diff --git a/tests/test-keyword b/tests/test-keyword
> --- a/tests/test-keyword
> +++ b/tests/test-keyword
> @@ -143,10 +143,8 @@
>   cat a c
>
>   echo % record
> -cp "$HGRCPATH" $HGRCPATH.bak
> -sed -e '1 a \foo' a>  a.tmp
> -mv a.tmp a
> -echo bar>>  a
> +python -c \
> +'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
>   hg record -d '1 10' -m rectest<<EOF
>   y
>   y
>
>    

Solaris is fine with this

/Mads


More information about the Mercurial-devel mailing list