Skip to content

Commit

Permalink
remote-hg: set stdout to binary mode on win32
Browse files Browse the repository at this point in the history
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 <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Amit Bakshi authored and Junio C Hamano committed May 20, 2013
1 parent de3a5c6 commit 5dbe064
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit 5dbe064

Please sign in to comment.