contrib/hgclient.py
changeset 40984 6a372f943e49
parent 40589 054d0fcba2c4
child 43076 2372284d9457
equal deleted inserted replaced
40983:70a00a8cd66e 40984:6a372f943e49
    31     cmdline = [b'hg', b'serve', b'--cmdserver', b'pipe']
    31     cmdline = [b'hg', b'serve', b'--cmdserver', b'pipe']
    32     if path:
    32     if path:
    33         cmdline += [b'-R', path]
    33         cmdline += [b'-R', path]
    34     cmdline.extend(extraargs)
    34     cmdline.extend(extraargs)
    35 
    35 
    36     server = subprocess.Popen(cmdline, stdin=subprocess.PIPE,
    36     def tonative(cmdline):
       
    37         if os.name != r'nt':
       
    38             return cmdline
       
    39         return [arg.decode("utf-8") for arg in cmdline]
       
    40 
       
    41     server = subprocess.Popen(tonative(cmdline), stdin=subprocess.PIPE,
    37                               stdout=subprocess.PIPE)
    42                               stdout=subprocess.PIPE)
    38 
    43 
    39     return server
    44     return server
    40 
    45 
    41 class unixconnection(object):
    46 class unixconnection(object):