<div dir="ltr"><div dir="ltr">On Sat, Mar 23, 2019 at 6:11 AM Yuya Nishihara <<a href="mailto:yuya@tcha.org">yuya@tcha.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Yuya Nishihara <<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>><br>
# Date 1553342347 -32400<br>
#      Sat Mar 23 20:59:07 2019 +0900<br>
# Node ID a669654065284444bc75ea8654b9e05928bcbb48<br>
# Parent  ba064f95175e6cb1467401a3a536d8c32229d4b1<br>
test-template: fix stdio mode on Windows<br></blockquote><div><br></div><div>Queued, thanks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Otherwise, CBOR data would be corrupted. Spotted by Matt Harbison.<br>
<br>
diff --git a/tests/test-template-functions.t b/tests/test-template-functions.t<br>
--- a/tests/test-template-functions.t<br>
+++ b/tests/test-template-functions.t<br>
@@ -1499,11 +1499,15 @@ Test cbor filter:<br>
<br>
   $ cat <<'EOF' > "$TESTTMP/decodecbor.py"<br>
   > from __future__ import absolute_import<br>
-  > from mercurial import pycompat<br>
+  > from mercurial import (<br>
+  >     dispatch,<br>
+  >     pycompat,<br>
+  > )<br>
   > from mercurial.utils import (<br>
   >     cborutil,<br>
   >     stringutil,<br>
   > )<br>
+  > dispatch.initstdio()<br>
   > items = cborutil.decodeall(pycompat.stdin.read())<br>
   > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n')<br>
   > EOF<br>
diff --git a/tests/test-template-map.t b/tests/test-template-map.t<br>
--- a/tests/test-template-map.t<br>
+++ b/tests/test-template-map.t<br>
@@ -673,11 +673,15 @@ test CBOR style:<br>
<br>
   $ cat <<'EOF' > "$TESTTMP/decodecborarray.py"<br>
   > from __future__ import absolute_import<br>
-  > from mercurial import pycompat<br>
+  > from mercurial import (<br>
+  >     dispatch,<br>
+  >     pycompat,<br>
+  > )<br>
   > from mercurial.utils import (<br>
   >     cborutil,<br>
   >     stringutil,<br>
   > )<br>
+  > dispatch.initstdio()<br>
   > data = pycompat.stdin.read()<br>
   > # our CBOR decoder doesn't support parsing indefinite-length arrays,<br>
   > # but the log output is indefinite stream by nature.<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>