Mercurial > public > mercurial-scm > hg
comparison mercurial/sshserver.py @ 5833:323b9c55b328
hook: redirect stdout to stderr for ssh and http servers
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 11 Jan 2008 13:06:38 -0600 |
parents | 63b9d2deed48 |
children | f89fd07fc51d |
comparison
equal
deleted
inserted
replaced
5832:2192ed187319 | 5833:323b9c55b328 |
---|---|
6 # This software may be used and distributed according to the terms | 6 # This software may be used and distributed according to the terms |
7 # of the GNU General Public License, incorporated herein by reference. | 7 # of the GNU General Public License, incorporated herein by reference. |
8 | 8 |
9 from i18n import _ | 9 from i18n import _ |
10 from node import * | 10 from node import * |
11 import os, streamclone, sys, tempfile, util | 11 import os, streamclone, sys, tempfile, util, hook |
12 | 12 |
13 class sshserver(object): | 13 class sshserver(object): |
14 def __init__(self, ui, repo): | 14 def __init__(self, ui, repo): |
15 self.ui = ui | 15 self.ui = ui |
16 self.repo = repo | 16 self.repo = repo |
17 self.lock = None | 17 self.lock = None |
18 self.fin = sys.stdin | 18 self.fin = sys.stdin |
19 self.fout = sys.stdout | 19 self.fout = sys.stdout |
20 | 20 |
21 hook.redirect(True) | |
21 sys.stdout = sys.stderr | 22 sys.stdout = sys.stderr |
22 | 23 |
23 # Prevent insertion/deletion of CRs | 24 # Prevent insertion/deletion of CRs |
24 util.set_binary(self.fin) | 25 util.set_binary(self.fin) |
25 util.set_binary(self.fout) | 26 util.set_binary(self.fout) |