git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remote-hg: set stdout to binary mode on win32
@ 2013-05-19 11:53 Felipe Contreras
  2013-05-19 12:00 ` Felipe Contreras
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Contreras @ 2013-05-19 11:53 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Amit Bakshi, Felipe Contreras

From: Amit Bakshi <ambakshi@gmail.com>

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.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index beb864b..01555dc 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/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'):
-- 
1.8.3.rc3.286.g3d43083

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-20 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-19 11:53 [PATCH] remote-hg: set stdout to binary mode on win32 Felipe Contreras
2013-05-19 12:00 ` Felipe Contreras
2013-05-20 18:18   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).