Mercurial > hg
comparison mercurial/util.py @ 2250:45aef5ddcdbe
windows: revlog.lazyparser not always safe to use.
can not use on windows < nt or if win32 api not available.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Wed, 10 May 2006 11:10:18 -0700 |
parents | 4a069064a39b |
children | 3d48eb68f3ee |
comparison
equal
deleted
inserted
replaced
2249:3e5fbf001f9b | 2250:45aef5ddcdbe |
---|---|
487 except AttributeError: | 487 except AttributeError: |
488 return os.stat(fp.name) | 488 return os.stat(fp.name) |
489 | 489 |
490 posixfile = file | 490 posixfile = file |
491 | 491 |
492 def is_win_9x(): | |
493 '''return true if run on windows 95, 98 or me.''' | |
494 try: | |
495 return sys.getwindowsversion()[3] == 1 | |
496 except AttributeError: | |
497 return os.name == 'nt' and 'command' in os.environ.get('comspec', '') | |
498 | |
492 # Platform specific variants | 499 # Platform specific variants |
493 if os.name == 'nt': | 500 if os.name == 'nt': |
494 demandload(globals(), "msvcrt") | 501 demandload(globals(), "msvcrt") |
495 nulldev = 'NUL:' | 502 nulldev = 'NUL:' |
496 | 503 |
568 return _("exited with status %d") % code, code | 575 return _("exited with status %d") % code, code |
569 | 576 |
570 try: | 577 try: |
571 # override functions with win32 versions if possible | 578 # override functions with win32 versions if possible |
572 from util_win32 import * | 579 from util_win32 import * |
580 if not is_win_9x(): | |
581 posixfile = posixfile_nt | |
573 except ImportError: | 582 except ImportError: |
574 pass | 583 pass |
575 | 584 |
576 else: | 585 else: |
577 nulldev = '/dev/null' | 586 nulldev = '/dev/null' |