##// END OF EJS Templates
util: move checklink() to posix.py and return False on Windows...
Adrian Buehlmann -
r13890:31eb145b default
parent child Browse files
Show More
@@ -135,6 +135,18 b' def checkexec(path):'
135 return False
135 return False
136 return not (new_file_has_exec or exec_flags_cannot_flip)
136 return not (new_file_has_exec or exec_flags_cannot_flip)
137
137
138 def checklink(path):
139 """check whether the given path is on a symlink-capable filesystem"""
140 # mktemp is not racy because symlink creation will fail if the
141 # file already exists
142 name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
143 try:
144 os.symlink(".", name)
145 os.unlink(name)
146 return True
147 except (OSError, AttributeError):
148 return False
149
138 def set_binary(fd):
150 def set_binary(fd):
139 pass
151 pass
140
152
@@ -683,18 +683,6 b' def fspath(name, root):'
683
683
684 return ''.join(result)
684 return ''.join(result)
685
685
686 def checklink(path):
687 """check whether the given path is on a symlink-capable filesystem"""
688 # mktemp is not racy because symlink creation will fail if the
689 # file already exists
690 name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
691 try:
692 os.symlink(".", name)
693 os.unlink(name)
694 return True
695 except (OSError, AttributeError):
696 return False
697
698 def checknlink(testfile):
686 def checknlink(testfile):
699 '''check whether hardlink count reporting works properly'''
687 '''check whether hardlink count reporting works properly'''
700
688
@@ -135,6 +135,9 b' def set_flags(f, l, x):'
135 def checkexec(path):
135 def checkexec(path):
136 return False
136 return False
137
137
138 def checklink(path):
139 return False
140
138 def set_binary(fd):
141 def set_binary(fd):
139 # When run without console, pipes may expose invalid
142 # When run without console, pipes may expose invalid
140 # fileno(), usually set to -1.
143 # fileno(), usually set to -1.
General Comments 0
You need to be logged in to leave comments. Login now