Mercurial > hg-stable
changeset 8011:25b63941b17b
util: don't overwrite os-specific functions with general ones
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Sat, 04 Apr 2009 18:12:43 +0200 |
parents | 58ba4b86ae13 |
children | 8c5f1b28e0bb |
files | mercurial/util.py |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Sun Apr 05 13:20:30 2009 +0200 +++ b/mercurial/util.py Sat Apr 04 18:12:43 2009 +0200 @@ -776,6 +776,19 @@ # want to add "foo/bar/baz" before checking if there's a "foo/.hg" self.auditeddir.update(prefixes) +def nlinks(pathname): + """Return number of hardlinks for the given file.""" + return os.lstat(pathname).st_nlink + +if hasattr(os, 'link'): + os_link = os.link +else: + def os_link(src, dst): + raise OSError(0, _("Hardlinks not supported")) + +def lookup_reg(key, name=None, scope=None): + return None + if os.name == 'nt': from windows import * def expand_glob(pats): @@ -817,16 +830,6 @@ pass return posixfile(pathname).read() -def nlinks(pathname): - """Return number of hardlinks for the given file.""" - return os.lstat(pathname).st_nlink - -if hasattr(os, 'link'): - os_link = os.link -else: - def os_link(src, dst): - raise OSError(0, _("Hardlinks not supported")) - def fstat(fp): '''stat file object that may not have fileno method.''' try: @@ -962,9 +965,6 @@ '''Are we running in a GUI?''' return os.name == "nt" or os.name == "mac" or os.environ.get("DISPLAY") -def lookup_reg(key, name=None, scope=None): - return None - def mktempcopy(name, emptyok=False, createmode=None): """Create a temporary file with the same contents from name