dispatch: write shell alias output to ui out descriptor
authorIdan Kamara <idankk86@gmail.com>
Tue, 07 Jun 2011 13:39:09 +0300
changeset 14640 406b6d7bdcb9
parent 14639 e59a7b8f521a
child 14641 f2789767a2c4
dispatch: write shell alias output to ui out descriptor
mercurial/dispatch.py
mercurial/util.py
--- a/mercurial/dispatch.py	Wed Jun 08 14:54:52 2011 +0300
+++ b/mercurial/dispatch.py	Tue Jun 07 13:39:09 2011 +0300
@@ -276,7 +276,7 @@
                 replace['0'] = self.name
                 replace['@'] = ' '.join(args)
                 cmd = util.interpolate(r'\$', replace, cmd, escape_prefix=True)
-                return util.system(cmd, environ=env)
+                return util.system(cmd, environ=env, out=ui.fout)
             self.fn = fn
             return
 
--- a/mercurial/util.py	Wed Jun 08 14:54:52 2011 +0300
+++ b/mercurial/util.py	Tue Jun 07 13:39:09 2011 +0300
@@ -354,7 +354,7 @@
     env = dict(os.environ)
     env.update((k, py2shell(v)) for k, v in environ.iteritems())
     env['HG'] = hgexecutable()
-    if out is None:
+    if out is None or out == sys.__stdout__:
         rc = subprocess.call(cmd, shell=True, close_fds=closefds,
                              env=env, cwd=cwd)
     else: