mercurial/util.py
changeset 10903 cd21bf199d17
parent 10898 5589110e9170
parent 10901 997173e49115
child 11011 648130161e4d
equal deleted inserted replaced
10900:cf016c9831d1 10903:cd21bf199d17
   687 
   687 
   688 def checklink(path):
   688 def checklink(path):
   689     """check whether the given path is on a symlink-capable filesystem"""
   689     """check whether the given path is on a symlink-capable filesystem"""
   690     # mktemp is not racy because symlink creation will fail if the
   690     # mktemp is not racy because symlink creation will fail if the
   691     # file already exists
   691     # file already exists
   692     name = tempfile.mktemp(dir=path)
   692     name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
   693     try:
   693     try:
   694         os.symlink(".", name)
   694         os.symlink(".", name)
   695         os.unlink(name)
   695         os.unlink(name)
   696         return True
   696         return True
   697     except (OSError, AttributeError):
   697     except (OSError, AttributeError):