comparison mercurial/util.py @ 14640:406b6d7bdcb9

dispatch: write shell alias output to ui out descriptor
author Idan Kamara <idankk86@gmail.com>
date Tue, 07 Jun 2011 13:39:09 +0300
parents 76f295eaed86
children 388af80c058b
comparison
equal deleted inserted replaced
14639:e59a7b8f521a 14640:406b6d7bdcb9
352 origcmd = cmd 352 origcmd = cmd
353 cmd = quotecommand(cmd) 353 cmd = quotecommand(cmd)
354 env = dict(os.environ) 354 env = dict(os.environ)
355 env.update((k, py2shell(v)) for k, v in environ.iteritems()) 355 env.update((k, py2shell(v)) for k, v in environ.iteritems())
356 env['HG'] = hgexecutable() 356 env['HG'] = hgexecutable()
357 if out is None: 357 if out is None or out == sys.__stdout__:
358 rc = subprocess.call(cmd, shell=True, close_fds=closefds, 358 rc = subprocess.call(cmd, shell=True, close_fds=closefds,
359 env=env, cwd=cwd) 359 env=env, cwd=cwd)
360 else: 360 else:
361 proc = subprocess.Popen(cmd, shell=True, close_fds=closefds, 361 proc = subprocess.Popen(cmd, shell=True, close_fds=closefds,
362 env=env, cwd=cwd, stdout=subprocess.PIPE, 362 env=env, cwd=cwd, stdout=subprocess.PIPE,