Patchwork [2,of,3] py3: restore perfstartup() prior to b456b2e0ad9f on Windows

login
register
mail settings
Submitter Matt Harbison
Date Oct. 18, 2018, 2:09 a.m.
Message ID <0f8e789ea9450bd401ca.1539828541@Envy>
Download mbox | patch
Permalink /patch/36114/
State Accepted
Headers show

Comments

Matt Harbison - Oct. 18, 2018, 2:09 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1539655330 14400
#      Mon Oct 15 22:02:10 2018 -0400
# Node ID 0f8e789ea9450bd401cadd53cdf1cb81ec688cb2
# Parent  d09e43b6d57e02680191b71823afa69a2e80581b
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

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -970,13 +970,13 @@  def perfindex(ui, repo, **opts):
 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()