comparison mercurial/util.py @ 2064:547ede0123a2

util.unlink should only catch OSError.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 13 Apr 2006 13:46:56 -0700
parents e18beba54a7e
children 67a0a3852024
comparison
equal deleted inserted replaced
2063:f1fda71e134e 2064:547ede0123a2
371 371
372 def unlink(f): 372 def unlink(f):
373 """unlink and remove the directory if it is empty""" 373 """unlink and remove the directory if it is empty"""
374 os.unlink(f) 374 os.unlink(f)
375 # try removing directories that might now be empty 375 # try removing directories that might now be empty
376 try: os.removedirs(os.path.dirname(f)) 376 try:
377 except: pass 377 os.removedirs(os.path.dirname(f))
378 except OSError:
379 pass
378 380
379 def copyfiles(src, dst, hardlink=None): 381 def copyfiles(src, dst, hardlink=None):
380 """Copy a directory tree using hardlinks if possible""" 382 """Copy a directory tree using hardlinks if possible"""
381 383
382 if hardlink is None: 384 if hardlink is None: