diff -r 58ba4b86ae13 -r 25b63941b17b mercurial/util.py --- 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