Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 5659:3da652f2039c
util: get rid of is_win_9x wart
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 18 Dec 2007 14:01:42 -0600 |
parents | 165cda754d9e |
children | 8e495dd6662e 479847ccabe0 |
line wrap: on
line diff
--- a/mercurial/util.py Sun Dec 09 17:14:38 2007 +0900 +++ b/mercurial/util.py Tue Dec 18 14:01:42 2007 -0600 @@ -772,12 +772,9 @@ posixfile = file -def is_win_9x(): - '''return true if run on windows 95, 98 or me.''' - try: - return sys.getwindowsversion()[3] == 1 - except AttributeError: - return os.name == 'nt' and 'command' in os.environ.get('comspec', '') +def openhardlinks(): + '''return true if it is safe to hold open file handles to hardlinks''' + return True getuser_fallback = None @@ -943,6 +940,16 @@ sys.stdout = winstdout(sys.stdout) + def _is_win_9x(): + '''return true if run on windows 95, 98 or me.''' + try: + return sys.getwindowsversion()[3] == 1 + except AttributeError: + return 'command' in os.environ.get('comspec', '') + + def openhardlinks(): + return not _is_win_9x and "win32api" in locals() + def system_rcpath(): try: return system_rcpath_win32() @@ -1074,7 +1081,7 @@ try: # override functions with win32 versions if possible from util_win32 import * - if not is_win_9x(): + if not _is_win_9x(): posixfile = posixfile_nt except ImportError: pass