Mercurial > hg
comparison hgext/convert/subversion.py @ 30261:6bed17ba00a1
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.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Oct 2015 14:34:56 +0900 |
parents | 21f977dbfaec |
children | 20a42325fdef |
comparison
equal
deleted
inserted
replaced
30260:21f977dbfaec | 30261:6bed17ba00a1 |
---|---|
3 # Copyright(C) 2007 Daniel Holth et al | 3 # Copyright(C) 2007 Daniel Holth et al |
4 from __future__ import absolute_import | 4 from __future__ import absolute_import |
5 | 5 |
6 import os | 6 import os |
7 import re | 7 import re |
8 import sys | |
9 import tempfile | 8 import tempfile |
10 import xml.dom.minidom | 9 import xml.dom.minidom |
11 | 10 |
12 from mercurial.i18n import _ | 11 from mercurial.i18n import _ |
13 from mercurial import ( | 12 from mercurial import ( |
162 """ | 161 """ |
163 if svn is None: | 162 if svn is None: |
164 raise error.Abort(_('debugsvnlog could not load Subversion python ' | 163 raise error.Abort(_('debugsvnlog could not load Subversion python ' |
165 'bindings')) | 164 'bindings')) |
166 | 165 |
167 args = decodeargs(sys.stdin.read()) | 166 args = decodeargs(ui.fin.read()) |
168 get_log_child(sys.stdout, *args) | 167 get_log_child(ui.fout, *args) |
169 | 168 |
170 class logstream(object): | 169 class logstream(object): |
171 """Interruptible revision log iterator.""" | 170 """Interruptible revision log iterator.""" |
172 def __init__(self, stdout): | 171 def __init__(self, stdout): |
173 self._stdout = stdout | 172 self._stdout = stdout |