##// END OF EJS Templates
tests/hghave: consistently use dir='.', prefix=tempprefix for tempfiles...
Mads Kiilerich -
r16968:456f457e default
parent child Browse files
Show More
@@ -50,7 +50,7 b' def has_mtn():'
50
50
51 def has_eol_in_paths():
51 def has_eol_in_paths():
52 try:
52 try:
53 fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r')
53 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r')
54 os.close(fd)
54 os.close(fd)
55 os.remove(path)
55 os.remove(path)
56 return True
56 return True
@@ -60,7 +60,7 b' def has_eol_in_paths():'
60 def has_executablebit():
60 def has_executablebit():
61 try:
61 try:
62 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
62 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
63 fh, fn = tempfile.mkstemp(dir=".", prefix='hg-checkexec-')
63 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
64 try:
64 try:
65 os.close(fh)
65 os.close(fh)
66 m = os.stat(fn).st_mode & 0777
66 m = os.stat(fn).st_mode & 0777
@@ -76,7 +76,7 b' def has_executablebit():'
76
76
77 def has_icasefs():
77 def has_icasefs():
78 # Stolen from mercurial.util
78 # Stolen from mercurial.util
79 fd, path = tempfile.mkstemp(prefix=tempprefix, dir='.')
79 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
80 os.close(fd)
80 os.close(fd)
81 try:
81 try:
82 s1 = os.stat(path)
82 s1 = os.stat(path)
@@ -105,7 +105,7 b' def has_fifo():'
105 def has_cacheable_fs():
105 def has_cacheable_fs():
106 from mercurial import util
106 from mercurial import util
107
107
108 fd, path = tempfile.mkstemp(prefix=tempprefix)
108 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
109 os.close(fd)
109 os.close(fd)
110 try:
110 try:
111 return util.cachestat(path).cacheable()
111 return util.cachestat(path).cacheable()
@@ -165,7 +165,7 b' def has_p4():'
165 def has_symlink():
165 def has_symlink():
166 if getattr(os, "symlink", None) is None:
166 if getattr(os, "symlink", None) is None:
167 return False
167 return False
168 name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
168 name = tempfile.mktemp(dir='.', prefix=tempprefix)
169 try:
169 try:
170 os.symlink(".", name)
170 os.symlink(".", name)
171 os.unlink(name)
171 os.unlink(name)
@@ -180,7 +180,7 b' def has_gpg():'
180 return matchoutput('gpg --version 2>&1', r'GnuPG')
180 return matchoutput('gpg --version 2>&1', r'GnuPG')
181
181
182 def has_unix_permissions():
182 def has_unix_permissions():
183 d = tempfile.mkdtemp(prefix=tempprefix, dir=".")
183 d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
184 try:
184 try:
185 fname = os.path.join(d, 'foo')
185 fname = os.path.join(d, 'foo')
186 for umask in (077, 007, 022):
186 for umask in (077, 007, 022):
General Comments 0
You need to be logged in to leave comments. Login now