changeset 13342:2dc7a2a96cfd

opener: use posixfile to hold file open when calling nlinks() Mercurial's posixfile is less intrusive on Windows than Python's open
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 02 Feb 2011 13:51:22 +0100
parents 4e33ef68b1f8
children 69e69b131458
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon Jan 17 09:37:20 2011 +0100
+++ b/mercurial/util.py	Wed Feb 02 13:51:22 2011 +0100
@@ -742,7 +742,7 @@
 
         # 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 @@
                 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)