py3: restore perfstartup() prior to b456b2e0ad9f on Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 15 Oct 2018 22:02:10 -0400
changeset 40349 1524c305377f
parent 40348 124507a263e5
child 40350 633da7139e4a
py3: restore perfstartup() prior to b456b2e0ad9f on Windows Otherwise the test errors out with: --- c:/Users/Matt/projects/hg_py3/tests/test-contrib-perf.t +++ c:/Users/Matt/projects/hg_py3/tests/test-contrib-perf.t.err @@ -184,6 +184,8 @@ $ hg perfrevrange $ hg perfrevset 'all()' $ hg perfstartup + 'b'c:' is not recognized as an internal or external command, + operable program or batch file. $ hg perfstatus $ hg perftags $ hg perftemplating
contrib/perf.py
--- a/contrib/perf.py	Wed Oct 17 21:05:43 2018 -0400
+++ b/contrib/perf.py	Mon Oct 15 22:02:10 2018 -0400
@@ -970,13 +970,13 @@
 def perfstartup(ui, repo, **opts):
     opts = _byteskwargs(opts)
     timer, fm = gettimer(ui, opts)
-    cmd = fsencode(sys.argv[0])
     def d():
         if os.name != r'nt':
-            os.system(b"HGRCPATH= %s version -q > /dev/null" % cmd)
+            os.system(b"HGRCPATH= %s version -q > /dev/null" %
+                      fsencode(sys.argv[0]))
         else:
             os.environ[r'HGRCPATH'] = r' '
-            os.system(r"%s version -q > NUL" % cmd)
+            os.system(r"%s version -q > NUL" % sys.argv[0])
     timer(d)
     fm.end()