mercurial/util.py
changeset 2064 547ede0123a2
parent 2054 e18beba54a7e
child 2071 67a0a3852024
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: