Patchwork [1,of,2,v2] tests: use $PYTHON in #! so we always use the right Python

login
register
mail settings
Submitter Augie Fackler
Date June 20, 2017, 2:47 a.m.
Message ID <d73d16aa95377376830b.1497926837@imladris.local>
Download mbox | patch
Permalink /patch/21520/
State Changes Requested
Headers show

Comments

Augie Fackler - June 20, 2017, 2:47 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1497551272 14400
#      Thu Jun 15 14:27:52 2017 -0400
# Node ID d73d16aa95377376830b01f31ce6fb84c4fc5cbf
# Parent  661025fd3e1cd5d5e2dee12b7f64312d6cd48a0b
tests: use $PYTHON in #! so we always use the right Python
Yuya Nishihara - June 20, 2017, 12:04 p.m.
On Mon, 19 Jun 2017 22:47:17 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1497551272 14400
> #      Thu Jun 15 14:27:52 2017 -0400
> # Node ID d73d16aa95377376830b01f31ce6fb84c4fc5cbf
> # Parent  661025fd3e1cd5d5e2dee12b7f64312d6cd48a0b
> tests: use $PYTHON in #! so we always use the right Python

> --- a/tests/test-highlight.t
> +++ b/tests/test-highlight.t
> @@ -20,7 +20,7 @@
>  create random Python file to exercise Pygments
>  
>    $ cat <<EOF > primes.py
> -  > #!/usr/bin/env python
> +  > #!$PYTHON
>    > 
>    > """Fun with generators. Corresponding Haskell implementation:
>    > 
> @@ -76,7 +76,7 @@ hgweb filerevision, html
>    <script type="text/javascript" src="/static/mercurial.js"></script>
>    
>    <link rel="stylesheet" href="/highlightcss" type="text/css" />
> -  <title>test: 06824edf55d0 primes.py</title>
> +  <title>test: effa151ac07c primes.py</title>

The hash depends on the $PYTHON value, so unreliable. I think primes.py
shouldn't use $PYTHON.

Patch

diff --git a/tests/test-bisect.t b/tests/test-bisect.t
--- a/tests/test-bisect.t
+++ b/tests/test-bisect.t
@@ -453,7 +453,7 @@  assuming that the shell returns 127 if c
 test bisecting command
 
   $ cat > script.py <<EOF
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > import sys
   > from mercurial import ui, hg
   > repo = hg.repository(ui.ui.load(), '.')
diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t
--- a/tests/test-extdiff.t
+++ b/tests/test-extdiff.t
@@ -249,7 +249,7 @@  Edit with extdiff -p:
 Prepare custom diff/edit tool:
 
   $ cat > 'diff tool.py' << EOT
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > import time
   > time.sleep(1) # avoid unchanged-timestamp problems
   > file('a/a', 'ab').write('edited\n')
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -98,7 +98,7 @@  Command with no output, we just want to 
 Check hgweb's load order:
 
   $ cat > hgweb.cgi <<EOF
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > from mercurial import demandimport; demandimport.enable()
   > from mercurial.hgweb import hgweb
   > from mercurial.hgweb import wsgicgi
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -20,7 +20,7 @@ 
 create random Python file to exercise Pygments
 
   $ cat <<EOF > primes.py
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > 
   > """Fun with generators. Corresponding Haskell implementation:
   > 
@@ -76,7 +76,7 @@  hgweb filerevision, html
   <script type="text/javascript" src="/static/mercurial.js"></script>
   
   <link rel="stylesheet" href="/highlightcss" type="text/css" />
-  <title>test: 06824edf55d0 primes.py</title>
+  <title>test: effa151ac07c primes.py</title>
   </head>
   <body>
   
@@ -114,7 +114,7 @@  hgweb filerevision, html
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   <h3>
-   view primes.py @ 0:<a href="/rev/06824edf55d0">06824edf55d0</a>
+   view primes.py @ 0:<a href="/rev/effa151ac07c">effa151ac07c</a>
    <span class="tag">tip</span> 
   </h3>
   
@@ -151,7 +151,7 @@  hgweb filerevision, html
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
   <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py" data-ishead="1">
-  <span id="l1"><span class="c">#!/usr/bin/env python</span></span><a href="#l1"></a>
+  <span id="l1"><span class="c">#!*</span></span><a href="#l1"></a> (glob)
   <span id="l2"></span><a href="#l2"></a>
   <span id="l3"><span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l3"></a>
   <span id="l4"></span><a href="#l4"></a>
@@ -250,7 +250,7 @@  hgweb fileannotate, html
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   <h3>
-   annotate primes.py @ 0:<a href="/rev/06824edf55d0">06824edf55d0</a>
+   annotate primes.py @ 0:<a href="/rev/effa151ac07c">effa151ac07c</a>
    <span class="tag">tip</span> 
   </h3>
   
@@ -295,36 +295,36 @@  hgweb fileannotate, html
     
   <tr id="l1" class="thisrev">
   <td class="annotate parity0">
-  <a href="/annotate/06824edf55d0/primes.py#l1">
+  <a href="/annotate/effa151ac07c/primes.py#l1">
   0
   </a>
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l1">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l1">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
-  <td class="source"><a href="#l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
+  <td class="source"><a href="#l1">     1</a> <span class="c">#!*</span></td> (glob)
   </tr>
   <tr id="l2" class="thisrev">
   <td class="annotate parity0">
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l2">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l2">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l2">     2</a> </td>
@@ -334,14 +334,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l3">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l3">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
@@ -351,14 +351,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l4">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l4">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l4">     4</a> </td>
@@ -368,14 +368,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l5">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l5">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
@@ -385,14 +385,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l6">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l6">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
@@ -402,14 +402,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l7">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l7">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
@@ -419,14 +419,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l8">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l8">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l8">     8</a> </td>
@@ -436,14 +436,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l9">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l9">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l9">     9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
@@ -453,14 +453,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l10">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l10">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l10">    10</a> </td>
@@ -470,14 +470,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l11">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l11">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
@@ -487,14 +487,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l12">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l12">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
@@ -504,14 +504,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l13">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l13">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l13">    13</a>     <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
@@ -521,14 +521,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l14">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l14">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l14">    14</a>         <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
@@ -538,14 +538,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l15">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l15">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
@@ -555,14 +555,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l16">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l16">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l16">    16</a>         <span class="c"># infinite recursion.</span></td>
@@ -572,14 +572,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l17">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l17">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
@@ -589,14 +589,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l18">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l18">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l18">    18</a>         <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
@@ -606,14 +606,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l19">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l19">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l19">    19</a>         <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
@@ -623,14 +623,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l20">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l20">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
@@ -640,14 +640,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l21">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l21">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l21">    21</a> </td>
@@ -657,14 +657,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l22">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l22">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l22">    22</a>     <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
@@ -674,14 +674,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l23">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l23">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
@@ -691,14 +691,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l24">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l24">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l24">    24</a> </td>
@@ -708,14 +708,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l25">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l25">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
@@ -725,14 +725,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l26">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l26">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
@@ -742,14 +742,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l27">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l27">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
@@ -759,14 +759,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l28">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l28">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l28">    28</a>         <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></td>
@@ -776,14 +776,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l29">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l29">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l29">    29</a>     <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
@@ -793,14 +793,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l30">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l30">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></td>
@@ -810,14 +810,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l31">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l31">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
@@ -827,14 +827,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l32">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l32">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
@@ -844,14 +844,14 @@  hgweb fileannotate, html
   
   <div class="annotate-info">
   <div>
-  <a href="/annotate/06824edf55d0/primes.py#l33">
-  06824edf55d0</a>
+  <a href="/annotate/effa151ac07c/primes.py#l33">
+  effa151ac07c</a>
   a
   </div>
   <div><em>&#116;&#101;&#115;&#116;</em></div>
   <div>parents: </div>
-  <a href="/diff/06824edf55d0/primes.py">diff</a>
-  <a href="/rev/06824edf55d0">changeset</a>
+  <a href="/diff/effa151ac07c/primes.py">diff</a>
+  <a href="/rev/effa151ac07c">changeset</a>
   </div>
   </td>
   <td class="source"><a href="#l33">    33</a> </td>
@@ -994,7 +994,7 @@  We attempt to highlight unknown files by
   > EOF
 
   $ cat > unknownfile << EOF
-  > #!/usr/bin/python
+  > #!$PYTHON
   > def foo():
   >    pass
   > EOF
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -93,7 +93,7 @@  Verify that largefiles from pulled branc
 Portable way to print file permissions:
 
   $ cat > ls-l.py <<EOF
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > import sys, os
   > path = sys.argv[1]
   > print '%03o' % (os.lstat(path).st_mode & 0777)
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -215,7 +215,7 @@  Test display of largefiles in hgweb
 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
 
   $ cat <<EOF > "$TESTTMP/hgweb.cgi"
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > from mercurial import demandimport; demandimport.enable()
   > from mercurial.hgweb import hgweb
   > from mercurial.hgweb import wsgicgi
diff --git a/tests/test-newcgi.t b/tests/test-newcgi.t
--- a/tests/test-newcgi.t
+++ b/tests/test-newcgi.t
@@ -5,7 +5,7 @@  before d74fc8dec2b4 still work.
 
   $ hg init test
   $ cat >hgweb.cgi <<HGWEB
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to use hgweb, edit as necessary
   > 
@@ -31,7 +31,7 @@  before d74fc8dec2b4 still work.
   > HGWEBDIRCONF
 
   $ cat >hgwebdir.cgi <<HGWEBDIR
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to export multiple hgweb repos, edit as necessary
   > 
diff --git a/tests/test-newercgi.t b/tests/test-newercgi.t
--- a/tests/test-newercgi.t
+++ b/tests/test-newercgi.t
@@ -5,7 +5,7 @@  This is a rudimentary test of the CGI fi
   $ hg init test
 
   $ cat >hgweb.cgi <<HGWEB
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to use hgweb, edit as necessary
   > 
@@ -28,7 +28,7 @@  This is a rudimentary test of the CGI fi
   > HGWEBDIRCONF
 
   $ cat >hgwebdir.cgi <<HGWEBDIR
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to export multiple hgweb repos, edit as necessary
   > 
diff --git a/tests/test-oldcgi.t b/tests/test-oldcgi.t
--- a/tests/test-oldcgi.t
+++ b/tests/test-oldcgi.t
@@ -4,7 +4,7 @@  This tests if CGI files from before d0db
 
   $ hg init test
   $ cat >hgweb.cgi <<HGWEB
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to use hgweb, edit as necessary
   > 
@@ -26,7 +26,7 @@  This tests if CGI files from before d0db
   > HGWEBDIRCONF
 
   $ cat >hgwebdir.cgi <<HGWEBDIR
-  > #!/usr/bin/env python
+  > #!$PYTHON
   > #
   > # An example CGI script to export multiple hgweb repos, edit as necessary
   > 
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -1001,7 +1001,7 @@  running is placed.
   > #endif
   >   $ test "\$RUNTESTDIR" = "$TESTDIR"
   >   $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py
-  >   #!/usr/bin/env python
+  >   #!$PYTHON
   >   #
   >   # check-code - a style and portability checker for Mercurial
   > EOF