comparison hglib/client.py @ 72:15485fa4b35e

util: introduce popen
author Idan Kamara <idankk86@gmail.com>
date Mon, 26 Sep 2011 22:37:44 +0300
parents 91ffa1de398c
children ca5f8f43e585
comparison
equal deleted inserted replaced
71:20ffb6486412 72:15485fa4b35e
17 '--config', 'ui.interactive=True'] 17 '--config', 'ui.interactive=True']
18 if path: 18 if path:
19 args += ['-R', path] 19 args += ['-R', path]
20 if configs: 20 if configs:
21 args += ['--config'] + configs 21 args += ['--config'] + configs
22 env = dict(os.environ) 22 env = {}
23 if encoding: 23 if encoding:
24 env['HGENCODING'] = encoding 24 env['HGENCODING'] = encoding
25 25
26 self.server = subprocess.Popen(args, stdin=subprocess.PIPE, 26 self.server = util.popen(args, env)
27 stdout=subprocess.PIPE, env=env,
28 close_fds=util.closefds)
29
30 self._readhello() 27 self._readhello()
31 self._version = None 28 self._version = None
32 29
33 def _readhello(self): 30 def _readhello(self):
34 """ read the hello message the server sends when started """ 31 """ read the hello message the server sends when started """