diff --git a/contrib/shrink-revlog.py b/contrib/shrink-revlog.py --- a/contrib/shrink-revlog.py +++ b/contrib/shrink-revlog.py @@ -251,8 +251,8 @@ def shrink(ui, repo, **opts): if not opts.get('dry_run'): # racy, both files cannot be renamed atomically # copy files - util.os_link(indexfn, oldindexfn) - ignoremissing(util.os_link)(datafn, olddatafn) + util.oslink(indexfn, oldindexfn) + ignoremissing(util.oslink)(datafn, olddatafn) # rename util.rename(tmpindexfn, indexfn) diff --git a/hgext/relink.py b/hgext/relink.py --- a/hgext/relink.py +++ b/hgext/relink.py @@ -132,7 +132,7 @@ def do_relink(src, dst, files, ui): bak = dst + '.bak' os.rename(dst, bak) try: - util.os_link(src, dst) + util.oslink(src, dst) except OSError: os.rename(bak, dst) raise diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -12,7 +12,7 @@ posixfile = open nulldev = '/dev/null' normpath = os.path.normpath samestat = os.path.samestat -os_link = os.link +oslink = os.link unlink = os.unlink rename = os.rename expandglobs = False diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -435,7 +435,7 @@ def copyfiles(src, dst, hardlink=None): else: if hardlink: try: - os_link(src, dst) + oslink(src, dst) except (IOError, OSError): hardlink = False shutil.copy(src, dst) @@ -624,7 +624,7 @@ def checknlink(testfile): fd = None try: try: - os_link(f1, f2) + oslink(f1, f2) except OSError: return False diff --git a/mercurial/win32.py b/mercurial/win32.py --- a/mercurial/win32.py +++ b/mercurial/win32.py @@ -140,7 +140,7 @@ def _getfileinfo(name): finally: _kernel32.CloseHandle(fh) -def os_link(src, dst): +def oslink(src, dst): try: if not _kernel32.CreateHardLinkA(dst, src, None): _raiseoserror(src)