[PATCH 08 of 12 RFC v2] dispatch: write shell alias output to ui out descriptor

Idan Kamara idankk86 at gmail.com
Wed Jun 15 16:09:20 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1307443149 -10800
# Node ID d31ea7146dc922ccbacc13b99cf34e2b8f381a91
# Parent  ed35f16e06099b9bd47be94cc1e669305c0d67f8
dispatch: write shell alias output to ui out descriptor

diff -r ed35f16e0609 -r d31ea7146dc9 mercurial/dispatch.py
--- a/mercurial/dispatch.py	Wed Jun 15 23:51:25 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
 
diff -r ed35f16e0609 -r d31ea7146dc9 mercurial/util.py
--- a/mercurial/util.py	Wed Jun 15 23:51:25 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:


More information about the Mercurial-devel mailing list