changeset 14612:4e1ccd4c2b6d

ui: add I/O descriptors
author Idan Kamara <idankk86@gmail.com>
date Tue, 07 Jun 2011 13:39:09 +0300
parents adbf5e7df96d
children ea8938d3a5aa
files mercurial/ui.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Tue Jun 14 23:26:35 2011 +0200
+++ b/mercurial/ui.py	Tue Jun 07 13:39:09 2011 +0300
@@ -21,6 +21,10 @@
         self._trustgroups = set()
 
         if src:
+            self.fout = src.fout
+            self.ferr = src.ferr
+            self.fin = src.fin
+
             self._tcfg = src._tcfg.copy()
             self._ucfg = src._ucfg.copy()
             self._ocfg = src._ocfg.copy()
@@ -29,6 +33,10 @@
             self.environ = src.environ
             self.fixconfig()
         else:
+            self.fout = sys.stdout
+            self.ferr = sys.stderr
+            self.fin = sys.stdin
+
             # shared read-only environment
             self.environ = os.environ
             # we always trust global config files