changeset 1415 | c6e6ca96a033 |
parent 1413 | 1c64c628d15f |
child 1420 | b32b3509c7ab |
--- a/mercurial/util.py Wed Oct 19 00:05:08 2005 -0700 +++ b/mercurial/util.py Wed Oct 19 00:10:52 2005 -0700 @@ -310,6 +310,13 @@ os.unlink(dst) os.rename(src, dst) +def unlink(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: pass + def copyfiles(src, dst, hardlink=None): """Copy a directory tree using hardlinks if possible"""