Show More
@@ -43,6 +43,9 b' from mercurial import (' | |||||
43 | ) |
|
43 | ) | |
44 |
|
44 | |||
45 | def main(): |
|
45 | def main(): | |
|
46 | # Prevent insertion/deletion of CRs | |||
|
47 | dispatch.initstdio() | |||
|
48 | ||||
46 | cwd = os.getcwd() |
|
49 | cwd = os.getcwd() | |
47 | readonly = False |
|
50 | readonly = False | |
48 | args = sys.argv[1:] |
|
51 | args = sys.argv[1:] |
@@ -83,7 +83,7 b' class request(object):' | |||||
83 |
|
83 | |||
84 | def run(): |
|
84 | def run(): | |
85 | "run the command in sys.argv" |
|
85 | "run the command in sys.argv" | |
86 |
|
|
86 | initstdio() | |
87 | req = request(pycompat.sysargv[1:]) |
|
87 | req = request(pycompat.sysargv[1:]) | |
88 | err = None |
|
88 | err = None | |
89 | try: |
|
89 | try: | |
@@ -112,7 +112,7 b' def run():' | |||||
112 | sys.exit(status & 255) |
|
112 | sys.exit(status & 255) | |
113 |
|
113 | |||
114 | if pycompat.ispy3: |
|
114 | if pycompat.ispy3: | |
115 |
def |
|
115 | def initstdio(): | |
116 | pass |
|
116 | pass | |
117 |
|
117 | |||
118 | def _silencestdio(): |
|
118 | def _silencestdio(): | |
@@ -132,7 +132,7 b' if pycompat.ispy3:' | |||||
132 | except IOError: |
|
132 | except IOError: | |
133 | pass |
|
133 | pass | |
134 | else: |
|
134 | else: | |
135 |
def |
|
135 | def initstdio(): | |
136 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
136 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
137 | procutil.setbinary(fp) |
|
137 | procutil.setbinary(fp) | |
138 |
|
138 |
@@ -798,10 +798,6 b' class sshserver(object):' | |||||
798 | hook.redirect(True) |
|
798 | hook.redirect(True) | |
799 | ui.fout = repo.ui.fout = ui.ferr |
|
799 | ui.fout = repo.ui.fout = ui.ferr | |
800 |
|
800 | |||
801 | # Prevent insertion/deletion of CRs |
|
|||
802 | procutil.setbinary(self._fin) |
|
|||
803 | procutil.setbinary(self._fout) |
|
|||
804 |
|
||||
805 | def serve_forever(self): |
|
801 | def serve_forever(self): | |
806 | self.serveuntil(threading.Event()) |
|
802 | self.serveuntil(threading.Event()) | |
807 | sys.exit(0) |
|
803 | sys.exit(0) |
General Comments 0
You need to be logged in to leave comments.
Login now