ui: add I/O descriptors
authorIdan Kamara <idankk86@gmail.com>
Tue, 07 Jun 2011 13:39:09 +0300
changeset 14612 4e1ccd4c2b6d
parent 14611 adbf5e7df96d
child 14613 ea8938d3a5aa
ui: add I/O descriptors
mercurial/ui.py
--- 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