##// END OF EJS Templates
hgweb: add links to diff and changeset in hover-box on annotate view
Denis Laxalde -
r29523:4b6afd1b default
parent child Browse files
Show More
@@ -104,6 +104,8 b" annotateline = '"
104 <div class="annotate-info">
104 <div class="annotate-info">
105 <div>{node|short}: {desc|escape|firstline}</div>
105 <div>{node|short}: {desc|escape|firstline}</div>
106 <div>parents: {parents%annotateparent}</div>
106 <div>parents: {parents%annotateparent}</div>
107 <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>
108 <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
107 </div>
109 </div>
108 </td>
110 </td>
109 <td><pre><a class="linenr" href="#{lineid}">{linenumber}</a></pre></td>
111 <td><pre><a class="linenr" href="#{lineid}">{linenumber}</a></pre></td>
@@ -100,6 +100,8 b" annotateline = '"
100 <div class="annotate-info">
100 <div class="annotate-info">
101 <div>{node|short}: {desc|escape|firstline}</div>
101 <div>{node|short}: {desc|escape|firstline}</div>
102 <div>parents: {parents%annotateparent}</div>
102 <div>parents: {parents%annotateparent}</div>
103 <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>
104 <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
103 </div>
105 </div>
104 </td>
106 </td>
105 <td class="lineno">
107 <td class="lineno">
@@ -85,6 +85,8 b" annotateline = '"
85 <div class="annotate-info">
85 <div class="annotate-info">
86 <div>{node|short}: {desc|escape|firstline}</div>
86 <div>{node|short}: {desc|escape|firstline}</div>
87 <div>parents: {parents%annotateparent}</div>
87 <div>parents: {parents%annotateparent}</div>
88 <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>
89 <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
88 </div>
90 </div>
89 </td>
91 </td>
90 <td class="source"><a href="#{lineid}">{linenumber}</a> {line|escape}</td>
92 <td class="source"><a href="#{lineid}">{linenumber}</a> {line|escape}</td>
@@ -63,6 +63,8 b" annotateline = '"
63 <div class="annotate-info">
63 <div class="annotate-info">
64 <div>{node|short}: {desc|escape|firstline}</div>
64 <div>{node|short}: {desc|escape|firstline}</div>
65 <div>parents: {parents%annotateparent}</div>
65 <div>parents: {parents%annotateparent}</div>
66 <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>
67 <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
66 </div>
68 </div>
67 </td>
69 </td>
68 <td>
70 <td>
@@ -191,8 +191,12 b' Set up the repo'
191 <td class="author"><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
191 <td class="author"><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
192 <td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
192 <td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
193 <a href="/annotate/43c799df6e75/foo?style=paper#l1">
193 <a href="/annotate/43c799df6e75/foo?style=paper#l1">
194 <a href="/diff/43c799df6e75/foo?style=paper">diff</a>
195 <a href="/rev/43c799df6e75?style=paper">changeset</a>
194 <a href="/annotate/a7c1559b7bba/foo?style=paper#l2">
196 <a href="/annotate/a7c1559b7bba/foo?style=paper#l2">
195 <a href="/annotate/43c799df6e75/foo?style=paper">0</a></div>
197 <a href="/annotate/43c799df6e75/foo?style=paper">0</a></div>
198 <a href="/diff/a7c1559b7bba/foo?style=paper">diff</a>
199 <a href="/rev/a7c1559b7bba?style=paper">changeset</a>
196
200
197 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
201 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
198 <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
202 <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
@@ -380,8 +384,12 b' Set up the repo'
380 <td class="author"><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
384 <td class="author"><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
381 <td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
385 <td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
382 <a href="/annotate/43c799df6e75/foo?style=coal#l1">
386 <a href="/annotate/43c799df6e75/foo?style=coal#l1">
387 <a href="/diff/43c799df6e75/foo?style=coal">diff</a>
388 <a href="/rev/43c799df6e75?style=coal">changeset</a>
383 <a href="/annotate/a7c1559b7bba/foo?style=coal#l2">
389 <a href="/annotate/a7c1559b7bba/foo?style=coal#l2">
384 <a href="/annotate/43c799df6e75/foo?style=coal">0</a></div>
390 <a href="/annotate/43c799df6e75/foo?style=coal">0</a></div>
391 <a href="/diff/a7c1559b7bba/foo?style=coal">diff</a>
392 <a href="/rev/a7c1559b7bba?style=coal">changeset</a>
385
393
386 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
394 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
387 <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
395 <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
@@ -619,8 +627,12 b' Set up the repo'
619 <a class="list" href="/annotate/43c799df6e75/foo?style=gitweb">
627 <a class="list" href="/annotate/43c799df6e75/foo?style=gitweb">
620 <a class="list" href="/annotate/9d8c40cba617/foo?style=gitweb">9d8c40cba617</a></td>
628 <a class="list" href="/annotate/9d8c40cba617/foo?style=gitweb">9d8c40cba617</a></td>
621 <a href="/annotate/43c799df6e75/foo?style=gitweb#l1">
629 <a href="/annotate/43c799df6e75/foo?style=gitweb#l1">
630 <a href="/diff/43c799df6e75/foo?style=gitweb">diff</a>
631 <a href="/rev/43c799df6e75?style=gitweb">changeset</a>
622 <a href="/annotate/a7c1559b7bba/foo?style=gitweb#l2">
632 <a href="/annotate/a7c1559b7bba/foo?style=gitweb#l2">
623 <a href="/annotate/43c799df6e75/foo?style=gitweb">0</a></div>
633 <a href="/annotate/43c799df6e75/foo?style=gitweb">0</a></div>
634 <a href="/diff/a7c1559b7bba/foo?style=gitweb">diff</a>
635 <a href="/rev/a7c1559b7bba?style=gitweb">changeset</a>
624
636
625 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS
637 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS
626 <a href="/file/xyzzy?style=gitweb">files</a> |
638 <a href="/file/xyzzy?style=gitweb">files</a> |
@@ -836,8 +848,12 b' Set up the repo'
836 <a href="/annotate/43c799df6e75/foo?style=monoblue">
848 <a href="/annotate/43c799df6e75/foo?style=monoblue">
837 <a href="/annotate/9d8c40cba617/foo?style=monoblue">9d8c40cba617</a>
849 <a href="/annotate/9d8c40cba617/foo?style=monoblue">9d8c40cba617</a>
838 <a href="/annotate/43c799df6e75/foo?style=monoblue#l1">
850 <a href="/annotate/43c799df6e75/foo?style=monoblue#l1">
851 <a href="/diff/43c799df6e75/foo?style=monoblue">diff</a>
852 <a href="/rev/43c799df6e75?style=monoblue">changeset</a>
839 <a href="/annotate/a7c1559b7bba/foo?style=monoblue#l2">
853 <a href="/annotate/a7c1559b7bba/foo?style=monoblue#l2">
840 <a href="/annotate/43c799df6e75/foo?style=monoblue">0</a></div>
854 <a href="/annotate/43c799df6e75/foo?style=monoblue">0</a></div>
855 <a href="/diff/a7c1559b7bba/foo?style=monoblue">diff</a>
856 <a href="/rev/a7c1559b7bba?style=monoblue">changeset</a>
841
857
842 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
858 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
843 <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
859 <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
@@ -1034,8 +1050,12 b' Set up the repo'
1034 <a href="/annotate/43c799df6e75/foo?style=spartan">
1050 <a href="/annotate/43c799df6e75/foo?style=spartan">
1035 <td><a href="/annotate/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
1051 <td><a href="/annotate/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
1036 <a href="/annotate/43c799df6e75/foo?style=spartan#l1">
1052 <a href="/annotate/43c799df6e75/foo?style=spartan#l1">
1053 <a href="/diff/43c799df6e75/foo?style=spartan">diff</a>
1054 <a href="/rev/43c799df6e75?style=spartan">changeset</a>
1037 <a href="/annotate/a7c1559b7bba/foo?style=spartan#l2">
1055 <a href="/annotate/a7c1559b7bba/foo?style=spartan#l2">
1038 <a href="/annotate/43c799df6e75/foo?style=spartan">0</a></div>
1056 <a href="/annotate/43c799df6e75/foo?style=spartan">0</a></div>
1057 <a href="/diff/a7c1559b7bba/foo?style=spartan">diff</a>
1058 <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
1039
1059
1040 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
1060 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
1041 <a href="/log/xyzzy?style=spartan">changelog</a>
1061 <a href="/log/xyzzy?style=spartan">changelog</a>
@@ -296,6 +296,8 b' hgweb fileannotate, html'
296 <div class="annotate-info">
296 <div class="annotate-info">
297 <div>06824edf55d0: a</div>
297 <div>06824edf55d0: a</div>
298 <div>parents: </div>
298 <div>parents: </div>
299 <a href="/diff/06824edf55d0/primes.py">diff</a>
300 <a href="/rev/06824edf55d0">changeset</a>
299 </div>
301 </div>
300 </td>
302 </td>
301 <td class="source"><a href="#l1"> 1</a> <span class="c">#!/usr/bin/env python</span></td>
303 <td class="source"><a href="#l1"> 1</a> <span class="c">#!/usr/bin/env python</span></td>
@@ -306,6 +308,8 b' hgweb fileannotate, html'
306 <div class="annotate-info">
308 <div class="annotate-info">
307 <div>06824edf55d0: a</div>
309 <div>06824edf55d0: a</div>
308 <div>parents: </div>
310 <div>parents: </div>
311 <a href="/diff/06824edf55d0/primes.py">diff</a>
312 <a href="/rev/06824edf55d0">changeset</a>
309 </div>
313 </div>
310 </td>
314 </td>
311 <td class="source"><a href="#l2"> 2</a> </td>
315 <td class="source"><a href="#l2"> 2</a> </td>
@@ -316,6 +320,8 b' hgweb fileannotate, html'
316 <div class="annotate-info">
320 <div class="annotate-info">
317 <div>06824edf55d0: a</div>
321 <div>06824edf55d0: a</div>
318 <div>parents: </div>
322 <div>parents: </div>
323 <a href="/diff/06824edf55d0/primes.py">diff</a>
324 <a href="/rev/06824edf55d0">changeset</a>
319 </div>
325 </div>
320 </td>
326 </td>
321 <td class="source"><a href="#l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
327 <td class="source"><a href="#l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
@@ -326,6 +332,8 b' hgweb fileannotate, html'
326 <div class="annotate-info">
332 <div class="annotate-info">
327 <div>06824edf55d0: a</div>
333 <div>06824edf55d0: a</div>
328 <div>parents: </div>
334 <div>parents: </div>
335 <a href="/diff/06824edf55d0/primes.py">diff</a>
336 <a href="/rev/06824edf55d0">changeset</a>
329 </div>
337 </div>
330 </td>
338 </td>
331 <td class="source"><a href="#l4"> 4</a> </td>
339 <td class="source"><a href="#l4"> 4</a> </td>
@@ -336,6 +344,8 b' hgweb fileannotate, html'
336 <div class="annotate-info">
344 <div class="annotate-info">
337 <div>06824edf55d0: a</div>
345 <div>06824edf55d0: a</div>
338 <div>parents: </div>
346 <div>parents: </div>
347 <a href="/diff/06824edf55d0/primes.py">diff</a>
348 <a href="/rev/06824edf55d0">changeset</a>
339 </div>
349 </div>
340 </td>
350 </td>
341 <td class="source"><a href="#l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
351 <td class="source"><a href="#l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
@@ -346,6 +356,8 b' hgweb fileannotate, html'
346 <div class="annotate-info">
356 <div class="annotate-info">
347 <div>06824edf55d0: a</div>
357 <div>06824edf55d0: a</div>
348 <div>parents: </div>
358 <div>parents: </div>
359 <a href="/diff/06824edf55d0/primes.py">diff</a>
360 <a href="/rev/06824edf55d0">changeset</a>
349 </div>
361 </div>
350 </td>
362 </td>
351 <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>
363 <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>
@@ -356,6 +368,8 b' hgweb fileannotate, html'
356 <div class="annotate-info">
368 <div class="annotate-info">
357 <div>06824edf55d0: a</div>
369 <div>06824edf55d0: a</div>
358 <div>parents: </div>
370 <div>parents: </div>
371 <a href="/diff/06824edf55d0/primes.py">diff</a>
372 <a href="/rev/06824edf55d0">changeset</a>
359 </div>
373 </div>
360 </td>
374 </td>
361 <td class="source"><a href="#l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></td>
375 <td class="source"><a href="#l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></td>
@@ -366,6 +380,8 b' hgweb fileannotate, html'
366 <div class="annotate-info">
380 <div class="annotate-info">
367 <div>06824edf55d0: a</div>
381 <div>06824edf55d0: a</div>
368 <div>parents: </div>
382 <div>parents: </div>
383 <a href="/diff/06824edf55d0/primes.py">diff</a>
384 <a href="/rev/06824edf55d0">changeset</a>
369 </div>
385 </div>
370 </td>
386 </td>
371 <td class="source"><a href="#l8"> 8</a> </td>
387 <td class="source"><a href="#l8"> 8</a> </td>
@@ -376,6 +392,8 b' hgweb fileannotate, html'
376 <div class="annotate-info">
392 <div class="annotate-info">
377 <div>06824edf55d0: a</div>
393 <div>06824edf55d0: a</div>
378 <div>parents: </div>
394 <div>parents: </div>
395 <a href="/diff/06824edf55d0/primes.py">diff</a>
396 <a href="/rev/06824edf55d0">changeset</a>
379 </div>
397 </div>
380 </td>
398 </td>
381 <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>
399 <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>
@@ -386,6 +404,8 b' hgweb fileannotate, html'
386 <div class="annotate-info">
404 <div class="annotate-info">
387 <div>06824edf55d0: a</div>
405 <div>06824edf55d0: a</div>
388 <div>parents: </div>
406 <div>parents: </div>
407 <a href="/diff/06824edf55d0/primes.py">diff</a>
408 <a href="/rev/06824edf55d0">changeset</a>
389 </div>
409 </div>
390 </td>
410 </td>
391 <td class="source"><a href="#l10"> 10</a> </td>
411 <td class="source"><a href="#l10"> 10</a> </td>
@@ -396,6 +416,8 b' hgweb fileannotate, html'
396 <div class="annotate-info">
416 <div class="annotate-info">
397 <div>06824edf55d0: a</div>
417 <div>06824edf55d0: a</div>
398 <div>parents: </div>
418 <div>parents: </div>
419 <a href="/diff/06824edf55d0/primes.py">diff</a>
420 <a href="/rev/06824edf55d0">changeset</a>
399 </div>
421 </div>
400 </td>
422 </td>
401 <td class="source"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
423 <td class="source"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
@@ -406,6 +428,8 b' hgweb fileannotate, html'
406 <div class="annotate-info">
428 <div class="annotate-info">
407 <div>06824edf55d0: a</div>
429 <div>06824edf55d0: a</div>
408 <div>parents: </div>
430 <div>parents: </div>
431 <a href="/diff/06824edf55d0/primes.py">diff</a>
432 <a href="/rev/06824edf55d0">changeset</a>
409 </div>
433 </div>
410 </td>
434 </td>
411 <td class="source"><a href="#l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
435 <td class="source"><a href="#l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
@@ -416,6 +440,8 b' hgweb fileannotate, html'
416 <div class="annotate-info">
440 <div class="annotate-info">
417 <div>06824edf55d0: a</div>
441 <div>06824edf55d0: a</div>
418 <div>parents: </div>
442 <div>parents: </div>
443 <a href="/diff/06824edf55d0/primes.py">diff</a>
444 <a href="/rev/06824edf55d0">changeset</a>
419 </div>
445 </div>
420 </td>
446 </td>
421 <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>
447 <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>
@@ -426,6 +452,8 b' hgweb fileannotate, html'
426 <div class="annotate-info">
452 <div class="annotate-info">
427 <div>06824edf55d0: a</div>
453 <div>06824edf55d0: a</div>
428 <div>parents: </div>
454 <div>parents: </div>
455 <a href="/diff/06824edf55d0/primes.py">diff</a>
456 <a href="/rev/06824edf55d0">changeset</a>
429 </div>
457 </div>
430 </td>
458 </td>
431 <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>
459 <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>
@@ -436,6 +464,8 b' hgweb fileannotate, html'
436 <div class="annotate-info">
464 <div class="annotate-info">
437 <div>06824edf55d0: a</div>
465 <div>06824edf55d0: a</div>
438 <div>parents: </div>
466 <div>parents: </div>
467 <a href="/diff/06824edf55d0/primes.py">diff</a>
468 <a href="/rev/06824edf55d0">changeset</a>
439 </div>
469 </div>
440 </td>
470 </td>
441 <td class="source"><a href="#l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
471 <td class="source"><a href="#l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
@@ -446,6 +476,8 b' hgweb fileannotate, html'
446 <div class="annotate-info">
476 <div class="annotate-info">
447 <div>06824edf55d0: a</div>
477 <div>06824edf55d0: a</div>
448 <div>parents: </div>
478 <div>parents: </div>
479 <a href="/diff/06824edf55d0/primes.py">diff</a>
480 <a href="/rev/06824edf55d0">changeset</a>
449 </div>
481 </div>
450 </td>
482 </td>
451 <td class="source"><a href="#l16"> 16</a> <span class="c"># infinite recursion.</span></td>
483 <td class="source"><a href="#l16"> 16</a> <span class="c"># infinite recursion.</span></td>
@@ -456,6 +488,8 b' hgweb fileannotate, html'
456 <div class="annotate-info">
488 <div class="annotate-info">
457 <div>06824edf55d0: a</div>
489 <div>06824edf55d0: a</div>
458 <div>parents: </div>
490 <div>parents: </div>
491 <a href="/diff/06824edf55d0/primes.py">diff</a>
492 <a href="/rev/06824edf55d0">changeset</a>
459 </div>
493 </div>
460 </td>
494 </td>
461 <td class="source"><a href="#l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></td>
495 <td class="source"><a href="#l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></td>
@@ -466,6 +500,8 b' hgweb fileannotate, html'
466 <div class="annotate-info">
500 <div class="annotate-info">
467 <div>06824edf55d0: a</div>
501 <div>06824edf55d0: a</div>
468 <div>parents: </div>
502 <div>parents: </div>
503 <a href="/diff/06824edf55d0/primes.py">diff</a>
504 <a href="/rev/06824edf55d0">changeset</a>
469 </div>
505 </div>
470 </td>
506 </td>
471 <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>
507 <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>
@@ -476,6 +512,8 b' hgweb fileannotate, html'
476 <div class="annotate-info">
512 <div class="annotate-info">
477 <div>06824edf55d0: a</div>
513 <div>06824edf55d0: a</div>
478 <div>parents: </div>
514 <div>parents: </div>
515 <a href="/diff/06824edf55d0/primes.py">diff</a>
516 <a href="/rev/06824edf55d0">changeset</a>
479 </div>
517 </div>
480 </td>
518 </td>
481 <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>
519 <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>
@@ -486,6 +524,8 b' hgweb fileannotate, html'
486 <div class="annotate-info">
524 <div class="annotate-info">
487 <div>06824edf55d0: a</div>
525 <div>06824edf55d0: a</div>
488 <div>parents: </div>
526 <div>parents: </div>
527 <a href="/diff/06824edf55d0/primes.py">diff</a>
528 <a href="/rev/06824edf55d0">changeset</a>
489 </div>
529 </div>
490 </td>
530 </td>
491 <td class="source"><a href="#l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></td>
531 <td class="source"><a href="#l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></td>
@@ -496,6 +536,8 b' hgweb fileannotate, html'
496 <div class="annotate-info">
536 <div class="annotate-info">
497 <div>06824edf55d0: a</div>
537 <div>06824edf55d0: a</div>
498 <div>parents: </div>
538 <div>parents: </div>
539 <a href="/diff/06824edf55d0/primes.py">diff</a>
540 <a href="/rev/06824edf55d0">changeset</a>
499 </div>
541 </div>
500 </td>
542 </td>
501 <td class="source"><a href="#l21"> 21</a> </td>
543 <td class="source"><a href="#l21"> 21</a> </td>
@@ -506,6 +548,8 b' hgweb fileannotate, html'
506 <div class="annotate-info">
548 <div class="annotate-info">
507 <div>06824edf55d0: a</div>
549 <div>06824edf55d0: a</div>
508 <div>parents: </div>
550 <div>parents: </div>
551 <a href="/diff/06824edf55d0/primes.py">diff</a>
552 <a href="/rev/06824edf55d0">changeset</a>
509 </div>
553 </div>
510 </td>
554 </td>
511 <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>
555 <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>
@@ -516,6 +560,8 b' hgweb fileannotate, html'
516 <div class="annotate-info">
560 <div class="annotate-info">
517 <div>06824edf55d0: a</div>
561 <div>06824edf55d0: a</div>
518 <div>parents: </div>
562 <div>parents: </div>
563 <a href="/diff/06824edf55d0/primes.py">diff</a>
564 <a href="/rev/06824edf55d0">changeset</a>
519 </div>
565 </div>
520 </td>
566 </td>
521 <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>
567 <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>
@@ -526,6 +572,8 b' hgweb fileannotate, html'
526 <div class="annotate-info">
572 <div class="annotate-info">
527 <div>06824edf55d0: a</div>
573 <div>06824edf55d0: a</div>
528 <div>parents: </div>
574 <div>parents: </div>
575 <a href="/diff/06824edf55d0/primes.py">diff</a>
576 <a href="/rev/06824edf55d0">changeset</a>
529 </div>
577 </div>
530 </td>
578 </td>
531 <td class="source"><a href="#l24"> 24</a> </td>
579 <td class="source"><a href="#l24"> 24</a> </td>
@@ -536,6 +584,8 b' hgweb fileannotate, html'
536 <div class="annotate-info">
584 <div class="annotate-info">
537 <div>06824edf55d0: a</div>
585 <div>06824edf55d0: a</div>
538 <div>parents: </div>
586 <div>parents: </div>
587 <a href="/diff/06824edf55d0/primes.py">diff</a>
588 <a href="/rev/06824edf55d0">changeset</a>
539 </div>
589 </div>
540 </td>
590 </td>
541 <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>
591 <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>
@@ -546,6 +596,8 b' hgweb fileannotate, html'
546 <div class="annotate-info">
596 <div class="annotate-info">
547 <div>06824edf55d0: a</div>
597 <div>06824edf55d0: a</div>
548 <div>parents: </div>
598 <div>parents: </div>
599 <a href="/diff/06824edf55d0/primes.py">diff</a>
600 <a href="/rev/06824edf55d0">changeset</a>
549 </div>
601 </div>
550 </td>
602 </td>
551 <td class="source"><a href="#l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></td>
603 <td class="source"><a href="#l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></td>
@@ -556,6 +608,8 b' hgweb fileannotate, html'
556 <div class="annotate-info">
608 <div class="annotate-info">
557 <div>06824edf55d0: a</div>
609 <div>06824edf55d0: a</div>
558 <div>parents: </div>
610 <div>parents: </div>
611 <a href="/diff/06824edf55d0/primes.py">diff</a>
612 <a href="/rev/06824edf55d0">changeset</a>
559 </div>
613 </div>
560 </td>
614 </td>
561 <td class="source"><a href="#l27"> 27</a> <span class="kn">try</span><span class="p">:</span></td>
615 <td class="source"><a href="#l27"> 27</a> <span class="kn">try</span><span class="p">:</span></td>
@@ -566,6 +620,8 b' hgweb fileannotate, html'
566 <div class="annotate-info">
620 <div class="annotate-info">
567 <div>06824edf55d0: a</div>
621 <div>06824edf55d0: a</div>
568 <div>parents: </div>
622 <div>parents: </div>
623 <a href="/diff/06824edf55d0/primes.py">diff</a>
624 <a href="/rev/06824edf55d0">changeset</a>
569 </div>
625 </div>
570 </td>
626 </td>
571 <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>
627 <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>
@@ -576,6 +632,8 b' hgweb fileannotate, html'
576 <div class="annotate-info">
632 <div class="annotate-info">
577 <div>06824edf55d0: a</div>
633 <div>06824edf55d0: a</div>
578 <div>parents: </div>
634 <div>parents: </div>
635 <a href="/diff/06824edf55d0/primes.py">diff</a>
636 <a href="/rev/06824edf55d0">changeset</a>
579 </div>
637 </div>
580 </td>
638 </td>
581 <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>
639 <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>
@@ -586,6 +644,8 b' hgweb fileannotate, html'
586 <div class="annotate-info">
644 <div class="annotate-info">
587 <div>06824edf55d0: a</div>
645 <div>06824edf55d0: a</div>
588 <div>parents: </div>
646 <div>parents: </div>
647 <a href="/diff/06824edf55d0/primes.py">diff</a>
648 <a href="/rev/06824edf55d0">changeset</a>
589 </div>
649 </div>
590 </td>
650 </td>
591 <td class="source"><a href="#l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></td>
651 <td class="source"><a href="#l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></td>
@@ -596,6 +656,8 b' hgweb fileannotate, html'
596 <div class="annotate-info">
656 <div class="annotate-info">
597 <div>06824edf55d0: a</div>
657 <div>06824edf55d0: a</div>
598 <div>parents: </div>
658 <div>parents: </div>
659 <a href="/diff/06824edf55d0/primes.py">diff</a>
660 <a href="/rev/06824edf55d0">changeset</a>
599 </div>
661 </div>
600 </td>
662 </td>
601 <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>
663 <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>
@@ -606,6 +668,8 b' hgweb fileannotate, html'
606 <div class="annotate-info">
668 <div class="annotate-info">
607 <div>06824edf55d0: a</div>
669 <div>06824edf55d0: a</div>
608 <div>parents: </div>
670 <div>parents: </div>
671 <a href="/diff/06824edf55d0/primes.py">diff</a>
672 <a href="/rev/06824edf55d0">changeset</a>
609 </div>
673 </div>
610 </td>
674 </td>
611 <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>
675 <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>
@@ -616,6 +680,8 b' hgweb fileannotate, html'
616 <div class="annotate-info">
680 <div class="annotate-info">
617 <div>06824edf55d0: a</div>
681 <div>06824edf55d0: a</div>
618 <div>parents: </div>
682 <div>parents: </div>
683 <a href="/diff/06824edf55d0/primes.py">diff</a>
684 <a href="/rev/06824edf55d0">changeset</a>
619 </div>
685 </div>
620 </td>
686 </td>
621 <td class="source"><a href="#l33"> 33</a> </td>
687 <td class="source"><a href="#l33"> 33</a> </td>
General Comments 0
You need to be logged in to leave comments. Login now