[PATCH 3 of 3] windows: use win32.unlink in unlinkpath()

Adrian Buehlmann adrian at cadifra.com
Sun Mar 27 06:01:39 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1301221327 -7200
# Node ID 9d23dce13e59c11f5d387701a4e4aac9b3c3eb79
# Parent  880472ae524d2fa412676459dbed80f22d4e47fb
windows: use win32.unlink in unlinkpath()

os.unlink fails to remove files with READONLY attribute

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -286,7 +286,7 @@ def _removedirs(name):
 
 def unlinkpath(f):
     """unlink and remove the directory if it is empty"""
-    os.unlink(f)
+    unlink(f)
     # try removing directories that might now be empty
     try:
         _removedirs(os.path.dirname(f))


More information about the Mercurial-devel mailing list