##// END OF EJS Templates
posix: move checklink test file to .hg/cache...
Mads Kiilerich -
r30447:0d87b1ca default
parent child Browse files
Show More
@@ -219,9 +219,16 def checklink(path):
219 219 # mktemp is not racy because symlink creation will fail if the
220 220 # file already exists
221 221 while True:
222 name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
222 cachedir = os.path.join(path, '.hg', 'cache')
223 if os.path.isdir(cachedir):
224 checkdir = cachedir
225 else:
226 checkdir = path
227 cachedir = None
228 name = tempfile.mktemp(dir=checkdir, prefix='checklink-')
223 229 try:
224 fd = tempfile.NamedTemporaryFile(dir=path, prefix='hg-checklink-')
230 fd = tempfile.NamedTemporaryFile(dir=checkdir,
231 prefix='hg-checklink-')
225 232 try:
226 233 os.symlink(os.path.basename(fd.name), name)
227 234 os.unlink(name)
General Comments 0
You need to be logged in to leave comments. Login now