# HG changeset patch # User Mads Kiilerich # Date 1339711347 -7200 # Node ID 55c85631631b3dcd4f96c3cb2ae415b150f6dbbb # Parent 72f57519a427eeba67961ae34b3c32c9fc633f3d tests/hghave: consistently use dir='.', prefix=tempprefix for tempfiles Some feature tests were done in the wrong directory and could thus give the wrong result. [ original upstream message ] diff -r 72f57519a427 -r 55c85631631b tests/hghave.py --- a/tests/hghave.py Thu Jun 14 12:54:54 2012 +0200 +++ b/tests/hghave.py Fri Jun 15 00:02:27 2012 +0200 @@ -50,7 +50,7 @@ def has_eol_in_paths(): try: - fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') + fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r') os.close(fd) os.remove(path) return True @@ -60,7 +60,7 @@ def has_executablebit(): try: EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH - fh, fn = tempfile.mkstemp(dir=".", prefix='hg-checkexec-') + fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix) try: os.close(fh) m = os.stat(fn).st_mode & 0777 @@ -76,7 +76,7 @@ def has_icasefs(): # Stolen from mercurial.util - fd, path = tempfile.mkstemp(prefix=tempprefix, dir='.') + fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) os.close(fd) try: s1 = os.stat(path) @@ -105,7 +105,7 @@ def has_cacheable_fs(): from mercurial import util - fd, path = tempfile.mkstemp(prefix=tempprefix) + fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) os.close(fd) try: return util.cachestat(path).cacheable() @@ -165,7 +165,7 @@ def has_symlink(): if getattr(os, "symlink", None) is None: return False - name = tempfile.mktemp(dir=".", prefix='hg-checklink-') + name = tempfile.mktemp(dir='.', prefix=tempprefix) try: os.symlink(".", name) os.unlink(name) @@ -180,7 +180,7 @@ return matchoutput('gpg --version 2>&1', r'GnuPG') def has_unix_permissions(): - d = tempfile.mkdtemp(prefix=tempprefix, dir=".") + d = tempfile.mkdtemp(dir='.', prefix=tempprefix) try: fname = os.path.join(d, 'foo') for umask in (077, 007, 022):