tests: fix test-commandserver phase . output for windows
authorBrendan Cully <brendan@kublai.com>
Fri, 03 May 2013 13:59:58 -0700
changeset 19132 605deb776abf
parent 19130 70f0d1da36b0
child 19133 101b80eb7364
tests: fix test-commandserver phase . output for windows
tests/test-commandserver.py
--- a/tests/test-commandserver.py	Fri May 03 15:34:18 2013 -0500
+++ b/tests/test-commandserver.py	Fri May 03 13:59:58 2013 -0700
@@ -25,7 +25,11 @@
     else:
         return channel, server.stdout.read(length)
 
-def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None):
+def sep(text):
+    return text.replace('\\', '/')
+
+def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
+               outfilter=lambda x: x):
     print ' runcommand', ' '.join(args)
     sys.stdout.flush()
     server.stdin.write('runcommand\n')
@@ -37,7 +41,7 @@
     while True:
         ch, data = readchannel(server)
         if ch == 'o':
-            output.write(data)
+            output.write(outfilter(data))
             output.flush()
         elif ch == 'e':
             error.write(data)
@@ -249,7 +253,8 @@
 
     # make it public; draft marker moves to 4:7966c8e3734d
     runcommand(server, ['phase', '-p', '.'])
-    runcommand(server, ['phase', '.'])  # load _phasecache.phaseroots
+    # load _phasecache.phaseroots
+    runcommand(server, ['phase', '.'], outfilter=sep)
 
     # strip 1::4 outside server
     os.system('hg --config extensions.mq= strip 1')