##// END OF EJS Templates
Avoid insertion/deletion of CRs on stdio during hg serve
olivier.maquelin@intel.com -
r1420:b32b3509 default
parent child Browse files
Show More
@@ -1512,6 +1512,10 b' def serve(ui, repo, **opts):'
1512 1512 fin, fout = sys.stdin, sys.stdout
1513 1513 sys.stdout = sys.stderr
1514 1514
1515 # Prevent insertion/deletion of CRs
1516 util.set_binary(fin)
1517 util.set_binary(fout)
1518
1515 1519 def getarg():
1516 1520 argline = fin.readline()[:-1]
1517 1521 arg, l = argline.split()
@@ -390,6 +390,7 b' else:'
390 390
391 391 # Platform specific variants
392 392 if os.name == 'nt':
393 demandload(globals(), "msvcrt")
393 394 nulldev = 'NUL:'
394 395
395 396 try:
@@ -438,6 +439,9 b" if os.name == 'nt':"
438 439 def set_exec(f, mode):
439 440 pass
440 441
442 def set_binary(fd):
443 msvcrt.setmode(fd.fileno(), os.O_BINARY)
444
441 445 def pconvert(path):
442 446 return path.replace("\\", "/")
443 447
@@ -484,6 +488,9 b' else:'
484 488 else:
485 489 os.chmod(f, s & 0666)
486 490
491 def set_binary(fd):
492 pass
493
487 494 def pconvert(path):
488 495 return path
489 496
General Comments 0
You need to be logged in to leave comments. Login now