# HG changeset patch
# User Adrian Buehlmann <adrian@cadifra.com>
# Date 1339161065 -7200
# Node ID e2d5315a6e38186c5dff1266b7d4fb0bacf6f1e0
# Parent  a2e8ccb652249a8ba0a0447894457833c7aeb799
tests/run-tests: use $TMP on Windows (issue3490)

This is just a short-term workaround for that issue. More work needs to be
done on scmutil.canonpath & friends.

$TMP on Windows is specified to be defined, and it has correct casing, so we
can use that as the default dir for tempfile.mkdtemp on Windows.

[ original upstream message ]

diff -r a2e8ccb65224 -r e2d5315a6e38 tests/run-tests.py
--- a/tests/run-tests.py	Fri Jun 01 02:25:12 2012 +0200
+++ b/tests/run-tests.py	Fri Jun 08 15:11:05 2012 +0200
@@ -1246,7 +1246,12 @@
             #shutil.rmtree(tmpdir)
         os.makedirs(tmpdir)
     else:
-        tmpdir = tempfile.mkdtemp('', 'hgtests.')
+        d = None
+        if os.name == 'nt':
+            # without this, we get the default temp dir location, but
+            # in all lowercase, which causes troubles with paths (issue3490)
+            d = os.getenv('TMP')
+        tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
     DAEMON_PIDS = None
     HGRCPATH = None