tests/hghave
branchstable
changeset 1055 dabed2cabd5e
parent 1032 5923d03569b3
child 1056 0e6cee08a2f8
equal deleted inserted replaced
1053:ede95d3a1f27 1055:dabed2cabd5e
   159 
   159 
   160 def has_p4():
   160 def has_p4():
   161     return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
   161     return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
   162 
   162 
   163 def has_symlink():
   163 def has_symlink():
       
   164     if not hasattr(os, "symlink"):
       
   165         return False
       
   166     name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
       
   167     try:
       
   168         os.symlink(".", name)
       
   169         os.unlink(name)
       
   170         return True
       
   171     except (OSError, AttributeError):
       
   172         return False
   164     return hasattr(os, "symlink") # FIXME: should also check file system and os
   173     return hasattr(os, "symlink") # FIXME: should also check file system and os
   165 
   174 
   166 def has_tla():
   175 def has_tla():
   167     return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
   176     return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
   168 
   177