Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 1420:b32b3509c7ab
Avoid insertion/deletion of CRs on stdio during hg serve
author | olivier.maquelin@intel.com |
---|---|
date | Mon, 24 Oct 2005 14:34:48 -0700 |
parents | c6e6ca96a033 |
children | 4babaa52badf |
comparison
equal
deleted
inserted
replaced
1419:22041f754f4a | 1420:b32b3509c7ab |
---|---|
388 def os_link(src, dst): | 388 def os_link(src, dst): |
389 raise OSError(0, _("Hardlinks not supported")) | 389 raise OSError(0, _("Hardlinks not supported")) |
390 | 390 |
391 # Platform specific variants | 391 # Platform specific variants |
392 if os.name == 'nt': | 392 if os.name == 'nt': |
393 demandload(globals(), "msvcrt") | |
393 nulldev = 'NUL:' | 394 nulldev = 'NUL:' |
394 | 395 |
395 try: | 396 try: |
396 import win32api, win32process | 397 import win32api, win32process |
397 filename = win32process.GetModuleFileNameEx(win32api.GetCurrentProcess(), 0) | 398 filename = win32process.GetModuleFileNameEx(win32api.GetCurrentProcess(), 0) |
435 def is_exec(f, last): | 436 def is_exec(f, last): |
436 return last | 437 return last |
437 | 438 |
438 def set_exec(f, mode): | 439 def set_exec(f, mode): |
439 pass | 440 pass |
441 | |
442 def set_binary(fd): | |
443 msvcrt.setmode(fd.fileno(), os.O_BINARY) | |
440 | 444 |
441 def pconvert(path): | 445 def pconvert(path): |
442 return path.replace("\\", "/") | 446 return path.replace("\\", "/") |
443 | 447 |
444 def localpath(path): | 448 def localpath(path): |
481 umask = os.umask(0) | 485 umask = os.umask(0) |
482 os.umask(umask) | 486 os.umask(umask) |
483 os.chmod(f, s | (s & 0444) >> 2 & ~umask) | 487 os.chmod(f, s | (s & 0444) >> 2 & ~umask) |
484 else: | 488 else: |
485 os.chmod(f, s & 0666) | 489 os.chmod(f, s & 0666) |
490 | |
491 def set_binary(fd): | |
492 pass | |
486 | 493 |
487 def pconvert(path): | 494 def pconvert(path): |
488 return path | 495 return path |
489 | 496 |
490 def localpath(path): | 497 def localpath(path): |