[PATCH STABLE] test-annotate: rewrite sed with some python

Matt Harbison mharbison72 at gmail.com
Sun Mar 4 14:59:15 EST 2018


On Sun, 04 Mar 2018 14:53:00 -0500, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sun, 04 Mar 2018 14:45:01 -0500, Matt Harbison wrote:
>> On Sun, 04 Mar 2018 13:24:20 -0500, Yuya Nishihara <yuya at tcha.org>  
>> wrote:
>>
>> > # HG changeset patch
>> > # User Yuya Nishihara <yuya at tcha.org>
>> > # Date 1520187545 18000
>> > #      Sun Mar 04 13:19:05 2018 -0500
>> > # Branch stable
>> > # Node ID 0c042b499ba989d193783a5cd64cca866ce01ae8
>> > # Parent  b394778b1a5042ca5799f5bae43620dd3324c797
>> > test-annotate: rewrite sed with some python
>>
>> No joy, on Windows anyway:
>
> Can you test this?
>
> diff --git a/tests/test-annotate.t b/tests/test-annotate.t
> --- a/tests/test-annotate.t
> +++ b/tests/test-annotate.t
> @@ -903,6 +903,9 @@ Annotate with orphaned CR (issue5798)
>   $ cat <<'EOF' >> "$TESTTMP/substcr.py"
>    > import sys
> +  > from mercurial import util
> +  > util.setbinary(sys.stdin)
> +  > util.setbinary(sys.stdout)
>    > stdin = getattr(sys.stdin, 'buffer', sys.stdin)
>    > stdout = getattr(sys.stdout, 'buffer', sys.stdout)
>    > stdout.write(stdin.read().replace(b'\r', b'[CR]'))

This does the trick for Windows, thanks.


More information about the Mercurial-devel mailing list