# HG changeset patch # User Adrian Buehlmann # Date 2011-07-22 07:55:46 # Node ID c627fe32c9238e07b4ddc583d62574cb146429e1 # Parent e2b5605501df88736a7d3e86f59ade58a936aa6b util: move "default" unlinkpath to posix.py we have a unlinkpath in windows.py diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -328,3 +328,13 @@ def termwidth(): 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 + diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -390,15 +390,6 @@ def checksignature(func): 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):