mercurial/util.py
changeset 31540 6d5b77abf306
parent 31539 52361c4f4dac
child 31541 bd9daafbf87c
equal deleted inserted replaced
31539:52361c4f4dac 31540:6d5b77abf306
  1614     # try removing directories that might now be empty
  1614     # try removing directories that might now be empty
  1615     try:
  1615     try:
  1616         removedirs(os.path.dirname(f))
  1616         removedirs(os.path.dirname(f))
  1617     except OSError:
  1617     except OSError:
  1618         pass
  1618         pass
       
  1619 
       
  1620 def tryunlink(f):
       
  1621     """Attempt to remove a file, ignoring ENOENT errors."""
       
  1622     try:
       
  1623         unlink(f)
       
  1624     except OSError as e:
       
  1625         if e.errno != errno.ENOENT:
       
  1626             raise
  1619 
  1627 
  1620 def makedirs(name, mode=None, notindexed=False):
  1628 def makedirs(name, mode=None, notindexed=False):
  1621     """recursive directory creation with parent mode inheritance
  1629     """recursive directory creation with parent mode inheritance
  1622 
  1630 
  1623     Newly created directories are marked as "not to be indexed by
  1631     Newly created directories are marked as "not to be indexed by