perf: adjust perfstartup() for Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 13 Dec 2015 18:13:44 -0500
changeset 27382 de7bcbc68042
parent 27381 988367ac2a2a
child 27383 b1160299a175
perf: adjust perfstartup() for Windows The /dev/null redirect was causing the following error: The system cannot find the path specified. Adjusting HGRCPATH as part of the command line causes the system to try to execute 'HGRCPATH'.
contrib/perf.py
--- a/contrib/perf.py	Sun Dec 13 15:36:20 2015 -0500
+++ b/contrib/perf.py	Sun Dec 13 18:13:44 2015 -0500
@@ -306,7 +306,11 @@
     timer, fm = gettimer(ui, opts)
     cmd = sys.argv[0]
     def d():
-        os.system("HGRCPATH= %s version -q > /dev/null" % cmd)
+        if os.name != 'nt':
+            os.system("HGRCPATH= %s version -q > /dev/null" % cmd)
+        else:
+            os.environ['HGRCPATH'] = ''
+            os.system("%s version -q > NUL" % cmd)
     timer(d)
     fm.end()