Mercurial > public > mercurial-scm > hg
comparison mercurial/sshserver.py @ 14614:afccc64eea73
ui: use I/O descriptors internally
and as a result:
- fix webproto to redirect the ui descriptors instead of sys.stdout/err
- fix sshserver to use the ui descriptors
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Wed, 08 Jun 2011 01:39:20 +0300 |
parents | 659f34b833b9 |
children | f4522df38c65 |
comparison
equal
deleted
inserted
replaced
14613:ea8938d3a5aa | 14614:afccc64eea73 |
---|---|
12 class sshserver(object): | 12 class sshserver(object): |
13 def __init__(self, ui, repo): | 13 def __init__(self, ui, repo): |
14 self.ui = ui | 14 self.ui = ui |
15 self.repo = repo | 15 self.repo = repo |
16 self.lock = None | 16 self.lock = None |
17 self.fin = sys.stdin | 17 self.fin = ui.fin |
18 self.fout = sys.stdout | 18 self.fout = ui.fout |
19 | 19 |
20 hook.redirect(True) | 20 hook.redirect(True) |
21 sys.stdout = sys.stderr | 21 ui.fout = repo.ui.fout = ui.ferr |
22 | 22 |
23 # Prevent insertion/deletion of CRs | 23 # Prevent insertion/deletion of CRs |
24 util.setbinary(self.fin) | 24 util.setbinary(self.fin) |
25 util.setbinary(self.fout) | 25 util.setbinary(self.fout) |
26 | 26 |