Patchwork [STABLE] test-annotate: set stdin and stdout to binary to get CR unmodified

login
register
mail settings
Submitter Yuya Nishihara
Date March 4, 2018, 8:05 p.m.
Message ID <f89bc48f38c7d87e0810.1520193953@mimosa>
Download mbox | patch
Permalink /patch/28982/
State Accepted
Headers show

Comments

Yuya Nishihara - March 4, 2018, 8:05 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520193237 18000
#      Sun Mar 04 14:53:57 2018 -0500
# Branch stable
# Node ID f89bc48f38c7d87e0810e9308e58bdf6ea565695
# Parent  9a08f7d18c207c590bab631b6daeb5ecfcb6d4b0
test-annotate: set stdin and stdout to binary to get CR unmodified
Augie Fackler - March 4, 2018, 8:30 p.m.
> On Mar 4, 2018, at 15:05, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1520193237 18000
> #      Sun Mar 04 14:53:57 2018 -0500
> # Branch stable
> # Node ID f89bc48f38c7d87e0810e9308e58bdf6ea565695
> # Parent  9a08f7d18c207c590bab631b6daeb5ecfcb6d4b0
> test-annotate: set stdin and stdout to binary to get CR unmodified

queued, thanks

> 
> 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]'))
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

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]'))