test-commandserver: allow check() to make connection in different way
authorYuya Nishihara <yuya@tcha.org>
Sat, 27 Sep 2014 23:14:26 +0900
changeset 22992 892b2b8c1b50
parent 22991 a94594f5d52f
child 22993 24c5fd2894f8
test-commandserver: allow check() to make connection in different way The next patch will add connector for 'unix' mode server.
contrib/hgclient.py
--- a/contrib/hgclient.py	Sat Sep 27 22:39:01 2014 +0900
+++ b/contrib/hgclient.py	Sat Sep 27 23:14:26 2014 +0900
@@ -2,7 +2,7 @@
 
 import sys, struct, subprocess, cStringIO
 
-def connect(path=None):
+def connectpipe(path=None):
     cmdline = ['hg', 'serve', '--cmdserver', 'pipe']
     if path:
         cmdline += ['-R', path]
@@ -62,7 +62,7 @@
             if ch.isupper():
                 return
 
-def check(func):
+def check(func, connect=connectpipe):
     sys.stdout.flush()
     server = connect()
     try: