Mercurial > hg
comparison mercurial/posix.py @ 14909:c627fe32c923
util: move "default" unlinkpath to posix.py
we have a unlinkpath in windows.py
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 22 Jul 2011 09:55:46 +0200 |
parents | e2b5605501df |
children | 570ea0259b0a |
comparison
equal
deleted
inserted
replaced
14908:e2b5605501df | 14909:c627fe32c923 |
---|---|
326 pass | 326 pass |
327 return 80 | 327 return 80 |
328 | 328 |
329 def makedir(path, notindexed): | 329 def makedir(path, notindexed): |
330 os.mkdir(path) | 330 os.mkdir(path) |
331 | |
332 def unlinkpath(f): | |
333 """unlink and remove the directory if it is empty""" | |
334 os.unlink(f) | |
335 # try removing directories that might now be empty | |
336 try: | |
337 os.removedirs(os.path.dirname(f)) | |
338 except OSError: | |
339 pass | |
340 |