# HG changeset patch # User Adrian Buehlmann # Date 2011-02-02 12:51:22 # Node ID 2dc7a2a96cfd6dcf233e38bc9b7db93e29d04c17 # Parent 4e33ef68b1f8e2b4f128edb2f2971eddf36cd8b2 opener: use posixfile to hold file open when calling nlinks() Mercurial's posixfile is less intrusive on Windows than Python's open diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -742,7 +742,7 @@ def checknlink(testfile): # nlinks() may behave differently for files on Windows shares if # the file is open. - fd = open(f2) + fd = posixfile(f2) return nlinks(f2) > 1 finally: if fd is not None: @@ -916,7 +916,7 @@ class opener(object): else: # nlinks() may behave differently for files on Windows # shares if the file is open. - fd = open(f) + fd = posixfile(f) nlink = nlinks(f) if nlink < 1: nlink = 2 # force mktempcopy (issue1922)