mercurial/posix.py
branchstable
changeset 26889 1aa5083cbebb
parent 26883 c750ed59892a
child 26901 0e3d093c468e
equal deleted inserted replaced
26888:271a802071b7 26889:1aa5083cbebb
   180                 return True
   180                 return True
   181             except OSError as inst:
   181             except OSError as inst:
   182                 # link creation might race, try again
   182                 # link creation might race, try again
   183                 if inst[0] == errno.EEXIST:
   183                 if inst[0] == errno.EEXIST:
   184                     continue
   184                     continue
   185                 # sshfs might report failure while successfully creating the link
   185                 raise
   186                 if inst[0] == errno.EIO and os.path.exists(name):
       
   187                     os.unlink(name)
       
   188                 return False
       
   189             finally:
   186             finally:
   190                 fd.close()
   187                 fd.close()
   191         except AttributeError:
   188         except AttributeError:
       
   189             return False
       
   190         except OSError as inst:
       
   191             # sshfs might report failure while successfully creating the link
       
   192             if inst[0] == errno.EIO and os.path.exists(name):
       
   193                 os.unlink(name)
   192             return False
   194             return False
   193 
   195 
   194 def checkosfilename(path):
   196 def checkosfilename(path):
   195     '''Check that the base-relative path is a valid filename on this platform.
   197     '''Check that the base-relative path is a valid filename on this platform.
   196     Returns None if the path is ok, or a UI string describing the problem.'''
   198     Returns None if the path is ok, or a UI string describing the problem.'''