[PATCH 1 of 2] tests: fix test-commandserver phase . output for windows

Brendan Cully brendan at kublai.com
Fri May 3 21:30:16 UTC 2013


# HG changeset patch
# User Brendan Cully <brendan at kublai.com>
# Date 1367614798 25200
#      Fri May 03 13:59:58 2013 -0700
# Node ID 605deb776abfec87ef568842d6505dc5713f8e25
# Parent  70f0d1da36b0b304ea00fbdd742285e2dc1c22eb
tests: fix test-commandserver phase . output for windows

diff -r 70f0d1da36b0 -r 605deb776abf 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')


More information about the Mercurial-devel mailing list