Show More
@@ -6,7 +6,7 b' import sys' | |||||
6 | from mercurial import revlog, node, util |
|
6 | from mercurial import revlog, node, util | |
7 |
|
7 | |||
8 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
8 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
9 |
util.set |
|
9 | util.setbinary(fp) | |
10 |
|
10 | |||
11 | for f in sys.argv[1:]: |
|
11 | for f in sys.argv[1:]: | |
12 | binopen = lambda fn: open(fn, 'rb') |
|
12 | binopen = lambda fn: open(fn, 'rb') |
@@ -43,7 +43,7 b' def showhelp():' | |||||
43 |
|
43 | |||
44 | try: |
|
44 | try: | |
45 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
45 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
46 |
util.set |
|
46 | util.setbinary(fp) | |
47 |
|
47 | |||
48 | opts = {} |
|
48 | opts = {} | |
49 | try: |
|
49 | try: |
@@ -7,7 +7,7 b' import sys' | |||||
7 | from mercurial import revlog, node, scmutil, util, transaction |
|
7 | from mercurial import revlog, node, scmutil, util, transaction | |
8 |
|
8 | |||
9 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
9 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
10 |
util.set |
|
10 | util.setbinary(fp) | |
11 |
|
11 | |||
12 | opener = scmutil.opener('.', False) |
|
12 | opener = scmutil.opener('.', False) | |
13 | tr = transaction.transaction(sys.stderr.write, opener, "undump.journal") |
|
13 | tr = transaction.transaction(sys.stderr.write, opener, "undump.journal") |
@@ -33,6 +33,6 b' import mercurial.util' | |||||
33 | import mercurial.dispatch |
|
33 | import mercurial.dispatch | |
34 |
|
34 | |||
35 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
35 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
36 |
mercurial.util.set |
|
36 | mercurial.util.setbinary(fp) | |
37 |
|
37 | |||
38 | mercurial.dispatch.run() |
|
38 | mercurial.dispatch.run() |
@@ -112,8 +112,8 b' def debugsvnlog(ui, **opts):' | |||||
112 | """Fetch SVN log in a subprocess and channel them back to parent to |
|
112 | """Fetch SVN log in a subprocess and channel them back to parent to | |
113 | avoid memory collection issues. |
|
113 | avoid memory collection issues. | |
114 | """ |
|
114 | """ | |
115 |
util.set |
|
115 | util.setbinary(sys.stdin) | |
116 |
util.set |
|
116 | util.setbinary(sys.stdout) | |
117 | args = decodeargs(sys.stdin.read()) |
|
117 | args = decodeargs(sys.stdin.read()) | |
118 | get_log_child(sys.stdout, *args) |
|
118 | get_log_child(sys.stdout, *args) | |
119 |
|
119 |
@@ -13,8 +13,8 b' from mercurial import util' | |||||
13 | from mercurial.hgweb import common |
|
13 | from mercurial.hgweb import common | |
14 |
|
14 | |||
15 | def launch(application): |
|
15 | def launch(application): | |
16 |
util.set |
|
16 | util.setbinary(sys.stdin) | |
17 |
util.set |
|
17 | util.setbinary(sys.stdout) | |
18 |
|
18 | |||
19 | environ = dict(os.environ.iteritems()) |
|
19 | environ = dict(os.environ.iteritems()) | |
20 | environ.setdefault('PATH_INFO', '') |
|
20 | environ.setdefault('PATH_INFO', '') |
@@ -128,7 +128,7 b' def checkosfilename(path):' | |||||
128 | Returns None if the path is ok, or a UI string describing the problem.''' |
|
128 | Returns None if the path is ok, or a UI string describing the problem.''' | |
129 | pass # on posix platforms, every path is ok |
|
129 | pass # on posix platforms, every path is ok | |
130 |
|
130 | |||
131 |
def set |
|
131 | def setbinary(fd): | |
132 | pass |
|
132 | pass | |
133 |
|
133 | |||
134 | def pconvert(path): |
|
134 | def pconvert(path): |
@@ -21,8 +21,8 b' class sshserver(object):' | |||||
21 | sys.stdout = sys.stderr |
|
21 | sys.stdout = sys.stderr | |
22 |
|
22 | |||
23 | # Prevent insertion/deletion of CRs |
|
23 | # Prevent insertion/deletion of CRs | |
24 |
util.set |
|
24 | util.setbinary(self.fin) | |
25 |
util.set |
|
25 | util.setbinary(self.fout) | |
26 |
|
26 | |||
27 | def getargs(self, args): |
|
27 | def getargs(self, args): | |
28 | data = {} |
|
28 | data = {} |
@@ -96,7 +96,7 b' def checkexec(path):' | |||||
96 | def checklink(path): |
|
96 | def checklink(path): | |
97 | return False |
|
97 | return False | |
98 |
|
98 | |||
99 |
def set |
|
99 | def setbinary(fd): | |
100 | # When run without console, pipes may expose invalid |
|
100 | # When run without console, pipes may expose invalid | |
101 | # fileno(), usually set to -1. |
|
101 | # fileno(), usually set to -1. | |
102 | if hasattr(fd, 'fileno') and fd.fileno() >= 0: |
|
102 | if hasattr(fd, 'fileno') and fd.fileno() >= 0: |
General Comments 0
You need to be logged in to leave comments.
Login now