equal
deleted
inserted
replaced
104 return True |
104 return True |
105 except ImportError: |
105 except ImportError: |
106 return False |
106 return False |
107 |
107 |
108 def has_fifo(): |
108 def has_fifo(): |
109 return hasattr(os, "mkfifo") |
109 return getattr(os, "mkfifo", None) is not None |
110 |
110 |
111 def has_cacheable_fs(): |
111 def has_cacheable_fs(): |
112 from mercurial import util |
112 from mercurial import util |
113 |
113 |
114 fd, path = tempfile.mkstemp(prefix=tempprefix) |
114 fd, path = tempfile.mkstemp(prefix=tempprefix) |
167 def has_p4(): |
167 def has_p4(): |
168 return (matchoutput('p4 -V', r'Rev\. P4/') and |
168 return (matchoutput('p4 -V', r'Rev\. P4/') and |
169 matchoutput('p4d -V', r'Rev\. P4D/')) |
169 matchoutput('p4d -V', r'Rev\. P4D/')) |
170 |
170 |
171 def has_symlink(): |
171 def has_symlink(): |
172 if not hasattr(os, "symlink"): |
172 if getattr(os, "symlink", None) is None: |
173 return False |
173 return False |
174 name = tempfile.mktemp(dir=".", prefix='hg-checklink-') |
174 name = tempfile.mktemp(dir=".", prefix='hg-checklink-') |
175 try: |
175 try: |
176 os.symlink(".", name) |
176 os.symlink(".", name) |
177 os.unlink(name) |
177 os.unlink(name) |