[PATCH] run-tests: expand --tmpdir and create it if needed

Nicolas Dumazet nicdumz at gmail.com
Sat Aug 15 07:23:55 CDT 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1250338797 -32400
# Node ID 26754719ff71fd01337149864629673281533f15
# Parent  cc3916411873596afa470e000d9436fff2939c59
run-tests: expand --tmpdir and create it if needed

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -167,6 +167,14 @@
     else:
         vlog = lambda *msg: None
 
+    if options.tmpdir:
+        options.tmpdir = os.path.expanduser(options.tmpdir)
+        try:
+            os.makedirs(options.tmpdir)
+        except OSError, err:
+            if err.errno != errno.EEXIST:
+                raise
+
     if options.jobs < 1:
         print >> sys.stderr, 'ERROR: -j/--jobs must be positive'
         sys.exit(1)


More information about the Mercurial-devel mailing list