changeset 38072:69779a222d5e

test-http-branchmap: fix encoding test to wrap the server stream Wrapping sys.std* streams has no effect since 39d13b8c101d, "py3: bulk replace sys.stdin/out/err by util's."
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 May 2018 11:08:35 +0900
parents a4a5c3085ea9
children 37ef6ee87488
files tests/test-http-branchmap.t
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-http-branchmap.t	Thu May 17 21:55:00 2018 +0900
+++ b/tests/test-http-branchmap.t	Sun May 13 11:08:35 2018 +0900
@@ -58,8 +58,8 @@
 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
 
   $ cat <<EOF > oldhg
-  > import sys
-  > from mercurial import ui, hg, commands
+  > import threading
+  > from mercurial import hg, ui, wireprotoserver
   > 
   > class StdoutWrapper(object):
   >     def __init__(self, stdout):
@@ -77,12 +77,11 @@
   >     def __getattr__(self, name):
   >         return getattr(self._file, name)
   > 
-  > sys.stdout = StdoutWrapper(getattr(sys.stdout, 'buffer', sys.stdout))
-  > sys.stderr = StdoutWrapper(getattr(sys.stderr, 'buffer', sys.stderr))
-  > 
   > myui = ui.ui.load()
+  > fout = StdoutWrapper(myui.fout)
+  > myui.fout = myui.ferr
   > repo = hg.repository(myui, b'a')
-  > commands.serve(myui, repo, stdio=True, cmdserver=False)
+  > wireprotoserver._runsshserver(myui, repo, myui.fin, fout, threading.Event())
   > EOF
   $ echo baz >> b/foo
   $ hg -R b ci -m baz