util: move "default" unlinkpath to posix.py
authorAdrian Buehlmann <adrian@cadifra.com>
Fri, 22 Jul 2011 09:55:46 +0200
changeset 14909 c627fe32c923
parent 14908 e2b5605501df
child 14910 570ea0259b0a
util: move "default" unlinkpath to posix.py we have a unlinkpath in windows.py
mercurial/posix.py
mercurial/util.py
--- a/mercurial/posix.py	Fri Jul 22 09:53:15 2011 +0200
+++ b/mercurial/posix.py	Fri Jul 22 09:55:46 2011 +0200
@@ -328,3 +328,13 @@
 
 def makedir(path, notindexed):
     os.mkdir(path)
+
+def unlinkpath(f):
+    """unlink and remove the directory if it is empty"""
+    os.unlink(f)
+    # try removing directories that might now be empty
+    try:
+        os.removedirs(os.path.dirname(f))
+    except OSError:
+        pass
+
--- a/mercurial/util.py	Fri Jul 22 09:53:15 2011 +0200
+++ b/mercurial/util.py	Fri Jul 22 09:55:46 2011 +0200
@@ -390,15 +390,6 @@
 
     return check
 
-def unlinkpath(f):
-    """unlink and remove the directory if it is empty"""
-    os.unlink(f)
-    # try removing directories that might now be empty
-    try:
-        os.removedirs(os.path.dirname(f))
-    except OSError:
-        pass
-
 def copyfile(src, dest):
     "copy a file, preserving mode and atime/mtime"
     if os.path.islink(src):