Patchwork [3,of,4] perf: adjust perfstartup() for Windows

login
register
mail settings
Submitter Matt Harbison
Date Dec. 14, 2015, 2:56 a.m.
Message ID <2f3f443558ecd5176b9e.1450061801@Envy>
Download mbox | patch
Permalink /patch/12027/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 14, 2015, 2:56 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1450048424 18000
#      Sun Dec 13 18:13:44 2015 -0500
# Node ID 2f3f443558ecd5176b9e6303cd98e1c97ad0f3db
# Parent  685b106ac877d0c28b0e4c2d9eed1b0498304401
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'.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -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()