From 61f92858a6d7259ae8232a6b6206602df8844b8e Mon Sep 17 00:00:00 2001 From: Amit Bakshi Date: Sun, 19 May 2013 06:53:48 -0500 Subject: [PATCH] remote-hg: set stdout to binary mode on win32 git clone hangs on windows, and file.write would return errno 22 inside of mercurial's windows.winstdout wrapper class. This patch sets stdout's mode to binary, fixing both issues. [fc: cleaned up] Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- git-remote-hg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-remote-hg b/git-remote-hg index beb864b..01555dc 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -954,6 +954,10 @@ def main(args): marks_path = os.path.join(dirname, 'marks-hg') marks = Marks(marks_path) + if sys.platform == 'win32': + import msvcrt + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + parser = Parser(repo) for line in parser: if parser.check('capabilities'):