Patchwork [5,of,7] test-commandserver: allow check() to make connection in different way

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 4, 2014, 10:52 a.m.
Message ID <48d895c10d39e370d102.1412419948@mimosa>
Download mbox | patch
Permalink /patch/6112/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 4, 2014, 10:52 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1411827266 -32400
#      Sat Sep 27 23:14:26 2014 +0900
# Node ID 48d895c10d39e370d1029e24119441aaf5ae898e
# Parent  a2ce71101853ef1eff92b301304b86ba25fb5b90
test-commandserver: allow check() to make connection in different way

The next patch will add connector for 'unix' mode server.

Patch

diff --git a/contrib/hgclient.py b/contrib/hgclient.py
--- a/contrib/hgclient.py
+++ b/contrib/hgclient.py
@@ -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 @@  def runcommand(server, args, output=sys.
             if ch.isupper():
                 return
 
-def check(func):
+def check(func, connect=connectpipe):
     sys.stdout.flush()
     server = connect()
     try: