Patchwork [V2] tests: change HGPROF environment var to be HG_PROF

login
register
mail settings
Submitter Durham Goode
Date March 12, 2013, 5:59 p.m.
Message ID <6b748f637490645d2f03.1363111168@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/1114/
State Superseded, archived
Headers show

Comments

Durham Goode - March 12, 2013, 5:59 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1363109868 25200
#      Tue Mar 12 10:37:48 2013 -0700
# Node ID 6b748f637490645d2f03142e4824739cfc0791b3
# Parent  018d68a30fe19e2d2c73d765306ba3156bb4957c
tests: change HGPROF environment var to be HG_PROF

The test-profile test would fail if the user had HGPROF set to another
profiler in their environment. This change makes HGPROF follow the naming
convention HG_... so that it is unset automatically as part of the test runner.
Pierre-Yves David - March 12, 2013, 6:11 p.m.
On Tue, Mar 12, 2013 at 10:59:28AM -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1363109868 25200
> #      Tue Mar 12 10:37:48 2013 -0700
> # Node ID 6b748f637490645d2f03142e4824739cfc0791b3
> # Parent  018d68a30fe19e2d2c73d765306ba3156bb4957c
> tests: change HGPROF environment var to be HG_PROF
> 
> The test-profile test would fail if the user had HGPROF set to another
> profiler in their environment. This change makes HGPROF follow the naming
> convention HG_... so that it is unset automatically as part of the test runner.

This needs a (BC) flag isn't it?
Durham Goode - March 12, 2013, 8:30 p.m.
On 3/12/13 10:59 AM, "Durham Goode" <durham@fb.com> wrote:

># HG changeset patch
># User Durham Goode <durham@fb.com>
># Date 1363109868 25200
>#      Tue Mar 12 10:37:48 2013 -0700
># Node ID 6b748f637490645d2f03142e4824739cfc0791b3
># Parent  018d68a30fe19e2d2c73d765306ba3156bb4957c
>tests: change HGPROF environment var to be HG_PROF
>
>The test-profile test would fail if the user had HGPROF set to another
>profiler in their environment. This change makes HGPROF follow the naming
>convention HG_... so that it is unset automatically as part of the test
>runner.
>
>diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
>--- a/mercurial/dispatch.py
>+++ b/mercurial/dispatch.py
>@@ -814,7 +814,7 @@
>             raise error.CommandError(cmd, _("invalid arguments"))
> 
>     if options['profile']:
>-        profiler = os.getenv('HGPROF')
>+        profiler = os.getenv('HG_PROF')
>         if profiler is None:
>             profiler = ui.config('profiling', 'type', default='ls')
>         if profiler not in ('ls', 'stat'):
>_______________________________________________
>Mercurial-devel mailing list
>Mercurial-devel@selenic.com
>http://selenic.com/mailman/listinfo/mercurial-devel
>

I talked with Bryan about this, and changing this environment variable
doesn't seem to be the right solution.  I sent another patch that just
addresses HGPROF specifically in run-tests.py

Durham

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -814,7 +814,7 @@ 
             raise error.CommandError(cmd, _("invalid arguments"))
 
     if options['profile']:
-        profiler = os.getenv('HGPROF')
+        profiler = os.getenv('HG_PROF')
         if profiler is None:
             profiler = ui.config('profiling', 'type', default='ls')
         if profiler not in ('ls', 'stat'):