convert: have debugsvnlog obtain standard streams from ui
authorYuya Nishihara <yuya@tcha.org>
Sat, 03 Oct 2015 14:34:56 +0900
changeset 30261 6bed17ba00a1
parent 30260 21f977dbfaec
child 30262 bc5d0e6fd9f3
convert: have debugsvnlog obtain standard streams from ui This will help porting to Python 3, where sys.stdin/out/err are unfortunately unicode streams so we can't use them directly.
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Sat Oct 03 14:29:13 2015 +0900
+++ b/hgext/convert/subversion.py	Sat Oct 03 14:34:56 2015 +0900
@@ -5,7 +5,6 @@
 
 import os
 import re
-import sys
 import tempfile
 import xml.dom.minidom
 
@@ -164,8 +163,8 @@
         raise error.Abort(_('debugsvnlog could not load Subversion python '
                            'bindings'))
 
-    args = decodeargs(sys.stdin.read())
-    get_log_child(sys.stdout, *args)
+    args = decodeargs(ui.fin.read())
+    get_log_child(ui.fout, *args)
 
 class logstream(object):
     """Interruptible revision log iterator."""