tests/test-highlight.t
author Brodie Rao <brodie@sf.io>
Sun, 13 May 2012 14:04:04 +0200
changeset 16719 e7bf09acd410
parent 16577 f208a4e20018
child 16913 f2719b387380
permissions -rw-r--r--
localrepo: add branchtip() method for faster single-branch lookups For the PyPy repo with 744 branches and 843 branch heads, this brings hg log -r default over NFS from: CallCount Recursive Total(ms) Inline(ms) module:lineno(function) 3249 0 1.3222 1.3222 <open> 3244 0 0.6211 0.6211 <method 'close' of 'file' objects> 3243 0 0.0800 0.0800 <method 'read' of 'file' objects> 3241 0 0.0660 0.0660 <method 'seek' of 'file' objects> 3905 0 0.0476 0.0476 <zlib.decompress> 3281 0 2.6756 0.0472 mercurial.changelog:182(read) +3281 0 2.5256 0.0453 +mercurial.revlog:881(revision) +3276 0 0.0389 0.0196 +mercurial.changelog:28(decodeextra) +6562 0 0.0123 0.0123 +<method 'split' of 'str' objects> +6562 0 0.0408 0.0073 +mercurial.encoding:61(tolocal) +3281 0 0.0054 0.0054 +<method 'index' of 'str' objects> 3241 0 2.2464 0.0456 mercurial.revlog:818(_loadchunk) +3241 0 0.6205 0.6205 +<method 'close' of 'file' objects> +3241 0 0.0765 0.0765 +<method 'read' of 'file' objects> +3241 0 0.0660 0.0660 +<method 'seek' of 'file' objects> +3241 0 1.4209 0.0135 +mercurial.store:374(__call__) +3241 0 0.0122 0.0107 +mercurial.revlog:810(_addchunk) 3281 0 2.5256 0.0453 mercurial.revlog:881(revision) +3280 0 0.0175 0.0175 +mercurial.revlog:305(rev) +3281 0 2.2819 0.0119 +mercurial.revlog:847(_chunkraw) +3281 0 0.0603 0.0083 +mercurial.revlog:945(_checkhash) +3281 0 0.0051 0.0051 +mercurial.revlog:349(flags) +3281 0 0.0040 0.0040 +<mercurial.mpatch.patches> 13682 0 0.0479 0.0248 <method 'decode' of 'str' objects> +7418 0 0.0228 0.0076 +encodings.utf_8:15(decode) +1 0 0.0003 0.0000 +encodings:71(search_function) 3248 0 1.3995 0.0246 mercurial.scmutil:218(__call__) +3248 0 1.3222 1.3222 +<open> +3248 0 0.0235 0.0184 +os.path:80(split) +3248 0 0.0084 0.0068 +mercurial.scmutil:92(__call__) Time: real 2.750 secs (user 0.680+0.000 sys 0.360+0.000) down to: CallCount Recursive Total(ms) Inline(ms) module:lineno(function) 55 31 0.0197 0.0163 <__import__> +1 0 0.0006 0.0002 +mercurial.context:8(<module>) +1 0 0.0042 0.0001 +mercurial.revlog:12(<module>) +1 0 0.0002 0.0001 +mercurial.match:8(<module>) +1 0 0.0003 0.0001 +mercurial.dirstate:7(<module>) +1 0 0.0057 0.0001 +mercurial.changelog:8(<module>) 1 0 0.0117 0.0032 mercurial.localrepo:525(_readbranchcache) +844 0 0.0015 0.0015 +<binascii.unhexlify> +845 0 0.0010 0.0010 +<method 'split' of 'str' objects> +843 0 0.0045 0.0009 +mercurial.encoding:61(tolocal) +843 0 0.0004 0.0004 +<method 'setdefault' of 'dict' objects> +1 0 0.0003 0.0003 +<method 'close' of 'file' objects> 3 0 0.0029 0.0029 <method 'read' of 'file' objects> 9 0 0.0018 0.0018 <open> 990 0 0.0017 0.0017 <binascii.unhexlify> 53 0 0.0016 0.0016 mercurial.demandimport:43(__init__) 862 0 0.0015 0.0015 <_codecs.utf_8_decode> 862 0 0.0037 0.0014 <method 'decode' of 'str' objects> +862 0 0.0023 0.0008 +encodings.utf_8:15(decode) 981 0 0.0011 0.0011 <method 'split' of 'str' objects> 861 0 0.0046 0.0009 mercurial.encoding:61(tolocal) +861 0 0.0037 0.0014 +<method 'decode' of 'str' objects> 862 0 0.0023 0.0008 encodings.utf_8:15(decode) +862 0 0.0015 0.0015 +<_codecs.utf_8_decode> 4 0 0.0008 0.0008 <method 'close' of 'file' objects> 179 154 0.0202 0.0004 mercurial.demandimport:83(__getattribute__) +36 11 0.0199 0.0003 +mercurial.demandimport:55(_load) +72 0 0.0001 0.0001 +mercurial.demandimport:83(__getattribute__) +36 0 0.0000 0.0000 +<getattr> 1 0 0.0015 0.0004 mercurial.tags:148(_readtagcache) Time: real 0.060 secs (user 0.030+0.000 sys 0.010+0.000)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6355
3b841c189ab7 tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     1
15446
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 15375
diff changeset
     2
  $ "$TESTDIR/hghave" pygments serve || exit 80
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     3
  $ cat <<EOF >> $HGRCPATH
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     4
  > [extensions]
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     5
  > highlight =
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     6
  > [web]
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     7
  > pygments_style = friendly
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     8
  > EOF
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
     9
  $ hg init test
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    10
  $ cd test
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    11
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    12
create random Python file to exercise Pygments
6355
3b841c189ab7 tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    13
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    14
  $ cat <<EOF > primes.py
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    15
  > #!/usr/bin/env python
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    16
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    17
  > """Fun with generators. Corresponding Haskell implementation:
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    18
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    19
  > primes = 2 : sieve [3, 5..]
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    20
  >     where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    21
  > """
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    22
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    23
  > from itertools import dropwhile, ifilter, islice, count, chain
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    24
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    25
  > def primes():
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    26
  >     """Generate all primes."""
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    27
  >     def sieve(ns):
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    28
  >         p = ns.next()
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    29
  >         # It is important to yield *here* in order to stop the
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    30
  >         # infinite recursion.
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    31
  >         yield p
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    32
  >         ns = ifilter(lambda n: n % p != 0, ns)
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    33
  >         for n in sieve(ns):
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    34
  >             yield n
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    35
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    36
  >     odds = ifilter(lambda i: i % 2 == 1, count())
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    37
  >     return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    38
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    39
  > if __name__ == "__main__":
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    40
  >     import sys
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    41
  >     try:
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    42
  >         n = int(sys.argv[1])
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    43
  >     except (ValueError, IndexError):
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    44
  >         n = 10
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    45
  >     p = primes()
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    46
  >     print "The first %d primes: %s" % (n, list(islice(p, n)))
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    47
  > EOF
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    48
  $ hg ci -Ama
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    49
  adding primes.py
8485
0b93eff3721d test-highlight: decouple test from get-with-headers.py
Martin Geisler <mg@lazybytes.net>
parents: 8083
diff changeset
    50
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    51
hg serve
8485
0b93eff3721d test-highlight: decouple test from get-with-headers.py
Martin Geisler <mg@lazybytes.net>
parents: 8083
diff changeset
    52
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    53
  $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    54
  $ cat hg.pid >> $DAEMON_PIDS
8485
0b93eff3721d test-highlight: decouple test from get-with-headers.py
Martin Geisler <mg@lazybytes.net>
parents: 8083
diff changeset
    55
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    56
hgweb filerevision, html
8485
0b93eff3721d test-highlight: decouple test from get-with-headers.py
Martin Geisler <mg@lazybytes.net>
parents: 8083
diff changeset
    57
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    58
  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py') \
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    59
  >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    60
  200 Script output follows
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    61
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    62
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    63
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    64
  <head>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    65
  <link rel="icon" href="/static/hgicon.png" type="image/png" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    66
  <meta name="robots" content="index, nofollow" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    67
  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
14053
139fb11210bb fix broken tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13618
diff changeset
    68
  <script type="text/javascript" src="/static/mercurial.js"></script>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    69
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    70
  <link rel="stylesheet" href="/highlightcss" type="text/css" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    71
  <title>test: 853dcd4de2a6 primes.py</title>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    72
  </head>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    73
  <body>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    74
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    75
  <div class="container">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    76
  <div class="menu">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    77
  <div class="logo">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    78
  <a href="http://mercurial.selenic.com/">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    79
  <img src="/static/hglogo.png" alt="mercurial" /></a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    80
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    81
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    82
  <li><a href="/shortlog/853dcd4de2a6">log</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    83
  <li><a href="/graph/853dcd4de2a6">graph</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    84
  <li><a href="/tags">tags</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    85
  <li><a href="/branches">branches</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    86
  </ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    87
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    88
  <li><a href="/rev/853dcd4de2a6">changeset</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    89
  <li><a href="/file/853dcd4de2a6/">browse</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    90
  </ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    91
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    92
  <li class="active">file</li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    93
  <li><a href="/file/tip/primes.py">latest</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    94
  <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    95
  <li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    96
  <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    97
  <li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
    98
  </ul>
12680
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
    99
  <ul>
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
   100
  <li><a href="/help">help</a></li>
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
   101
  </ul>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   102
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   103
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   104
  <div class="main">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   105
  <h2><a href="/">test</a></h2>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   106
  <h3>view primes.py @ 0:853dcd4de2a6</h3>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   107
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   108
  <form class="search" action="/log">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   109
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   110
  <p><input name="rev" id="search1" type="text" size="30" /></p>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   111
  <div id="hint">find changesets by author, revision,
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   112
  files, or words in the commit message</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   113
  </form>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   114
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   115
  <div class="description">a</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   116
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   117
  <table id="changesetEntry">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   118
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   119
   <th class="author">author</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   120
   <td class="author">&#116;&#101;&#115;&#116;</td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   121
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   122
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   123
   <th class="date">date</th>
15375
fe9d36a6853e hgweb: fix dynamic date calculation not working under Safari
Brodie Rao <brodie@bitheap.org>
parents: 15243
diff changeset
   124
   <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   125
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   126
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   127
   <th class="author">parents</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   128
   <td class="author"></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   129
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   130
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   131
   <th class="author">children</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   132
   <td class="author"></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   133
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   134
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   135
  </table>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   136
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   137
  <div class="overflow">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   138
  <div class="sourcefirst"> line source</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   139
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   140
  <div class="parity0 source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   141
  <div class="parity1 source"><a href="#l2" id="l2">     2</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   142
  <div class="parity0 source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   143
  <div class="parity1 source"><a href="#l4" id="l4">     4</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   144
  <div class="parity0 source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   145
  <div class="parity1 source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   146
  <div class="parity0 source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   147
  <div class="parity1 source"><a href="#l8" id="l8">     8</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   148
  <div class="parity0 source"><a href="#l9" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   149
  <div class="parity1 source"><a href="#l10" id="l10">    10</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   150
  <div class="parity0 source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   151
  <div class="parity1 source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   152
  <div class="parity0 source"><a href="#l13" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   153
  <div class="parity1 source"><a href="#l14" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   154
  <div class="parity0 source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   155
  <div class="parity1 source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   156
  <div class="parity0 source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   157
  <div class="parity1 source"><a href="#l18" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   158
  <div class="parity0 source"><a href="#l19" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   159
  <div class="parity1 source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   160
  <div class="parity0 source"><a href="#l21" id="l21">    21</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   161
  <div class="parity1 source"><a href="#l22" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   162
  <div class="parity0 source"><a href="#l23" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   163
  <div class="parity1 source"><a href="#l24" id="l24">    24</a> </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   164
  <div class="parity0 source"><a href="#l25" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   165
  <div class="parity1 source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   166
  <div class="parity0 source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   167
  <div class="parity1 source"><a href="#l28" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   168
  <div class="parity0 source"><a href="#l29" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   169
  <div class="parity1 source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   170
  <div class="parity0 source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   171
  <div class="parity1 source"><a href="#l32" id="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></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   172
  <div class="sourcelast"></div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   173
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   174
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   175
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   176
  
14053
139fb11210bb fix broken tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13618
diff changeset
   177
  <script type="text/javascript">process_dates()</script>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   178
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   179
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   180
  </body>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   181
  </html>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   182
  
8485
0b93eff3721d test-highlight: decouple test from get-with-headers.py
Martin Geisler <mg@lazybytes.net>
parents: 8083
diff changeset
   183
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   184
hgweb fileannotate, html
6987
d09e813b21e3 highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents: 6863
diff changeset
   185
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   186
  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   187
  >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   188
  200 Script output follows
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   189
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   190
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   191
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   192
  <head>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   193
  <link rel="icon" href="/static/hgicon.png" type="image/png" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   194
  <meta name="robots" content="index, nofollow" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   195
  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
14053
139fb11210bb fix broken tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13618
diff changeset
   196
  <script type="text/javascript" src="/static/mercurial.js"></script>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   197
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   198
  <link rel="stylesheet" href="/highlightcss" type="text/css" />
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   199
  <title>test: primes.py annotate</title>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   200
  </head>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   201
  <body>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   202
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   203
  <div class="container">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   204
  <div class="menu">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   205
  <div class="logo">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   206
  <a href="http://mercurial.selenic.com/">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   207
  <img src="/static/hglogo.png" alt="mercurial" /></a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   208
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   209
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   210
  <li><a href="/shortlog/853dcd4de2a6">log</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   211
  <li><a href="/graph/853dcd4de2a6">graph</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   212
  <li><a href="/tags">tags</a></li>
13618
b217619a6cf5 test-highlight: fix test output (introduced by 2151703e7f84)
Patrick Mezard <pmezard@gmail.com>
parents: 12943
diff changeset
   213
  <li><a href="/bookmarks">bookmarks</a></li>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   214
  <li><a href="/branches">branches</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   215
  </ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   216
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   217
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   218
  <li><a href="/rev/853dcd4de2a6">changeset</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   219
  <li><a href="/file/853dcd4de2a6/">browse</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   220
  </ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   221
  <ul>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   222
  <li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   223
  <li><a href="/file/tip/primes.py">latest</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   224
  <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   225
  <li class="active">annotate</li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   226
  <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   227
  <li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   228
  </ul>
12680
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
   229
  <ul>
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
   230
  <li><a href="/help">help</a></li>
d664547ef540 hgweb: add help link to templates missed in ead4e21f49f1
Augie Fackler <durin42@gmail.com>
parents: 12445
diff changeset
   231
  </ul>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   232
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   233
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   234
  <div class="main">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   235
  <h2><a href="/">test</a></h2>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   236
  <h3>annotate primes.py @ 0:853dcd4de2a6</h3>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   237
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   238
  <form class="search" action="/log">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   239
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   240
  <p><input name="rev" id="search1" type="text" size="30" /></p>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   241
  <div id="hint">find changesets by author, revision,
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   242
  files, or words in the commit message</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   243
  </form>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   244
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   245
  <div class="description">a</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   246
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   247
  <table id="changesetEntry">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   248
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   249
   <th class="author">author</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   250
   <td class="author">&#116;&#101;&#115;&#116;</td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   251
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   252
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   253
   <th class="date">date</th>
15375
fe9d36a6853e hgweb: fix dynamic date calculation not working under Safari
Brodie Rao <brodie@bitheap.org>
parents: 15243
diff changeset
   254
   <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   255
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   256
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   257
   <th class="author">parents</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   258
   <td class="author"></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   259
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   260
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   261
   <th class="author">children</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   262
   <td class="author"></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   263
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   264
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   265
  </table>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   266
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   267
  <div class="overflow">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   268
  <table class="bigtable">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   269
  <tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   270
   <th class="annotate">rev</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   271
   <th class="line">&nbsp;&nbsp;line source</th>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   272
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   273
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   274
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   275
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   276
  <a href="/annotate/853dcd4de2a6/primes.py#l1"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   277
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   278
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   279
  <td class="source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   280
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   281
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   282
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   283
  <a href="/annotate/853dcd4de2a6/primes.py#l2"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   284
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   285
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   286
  <td class="source"><a href="#l2" id="l2">     2</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   287
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   288
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   289
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   290
  <a href="/annotate/853dcd4de2a6/primes.py#l3"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   291
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   292
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   293
  <td class="source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   294
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   295
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   296
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   297
  <a href="/annotate/853dcd4de2a6/primes.py#l4"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   298
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   299
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   300
  <td class="source"><a href="#l4" id="l4">     4</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   301
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   302
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   303
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   304
  <a href="/annotate/853dcd4de2a6/primes.py#l5"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   305
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   306
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   307
  <td class="source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   308
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   309
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   310
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   311
  <a href="/annotate/853dcd4de2a6/primes.py#l6"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   312
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   313
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   314
  <td class="source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   315
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   316
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   317
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   318
  <a href="/annotate/853dcd4de2a6/primes.py#l7"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   319
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   320
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   321
  <td class="source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   322
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   323
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   324
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   325
  <a href="/annotate/853dcd4de2a6/primes.py#l8"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   326
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   327
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   328
  <td class="source"><a href="#l8" id="l8">     8</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   329
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   330
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   331
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   332
  <a href="/annotate/853dcd4de2a6/primes.py#l9"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   333
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   334
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   335
  <td class="source"><a href="#l9" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   336
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   337
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   338
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   339
  <a href="/annotate/853dcd4de2a6/primes.py#l10"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   340
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   341
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   342
  <td class="source"><a href="#l10" id="l10">    10</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   343
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   344
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   345
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   346
  <a href="/annotate/853dcd4de2a6/primes.py#l11"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   347
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   348
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   349
  <td class="source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   350
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   351
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   352
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   353
  <a href="/annotate/853dcd4de2a6/primes.py#l12"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   354
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   355
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   356
  <td class="source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   357
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   358
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   359
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   360
  <a href="/annotate/853dcd4de2a6/primes.py#l13"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   361
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   362
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   363
  <td class="source"><a href="#l13" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   364
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   365
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   366
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   367
  <a href="/annotate/853dcd4de2a6/primes.py#l14"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   368
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   369
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   370
  <td class="source"><a href="#l14" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   371
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   372
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   373
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   374
  <a href="/annotate/853dcd4de2a6/primes.py#l15"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   375
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   376
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   377
  <td class="source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   378
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   379
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   380
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   381
  <a href="/annotate/853dcd4de2a6/primes.py#l16"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   382
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   383
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   384
  <td class="source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   385
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   386
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   387
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   388
  <a href="/annotate/853dcd4de2a6/primes.py#l17"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   389
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   390
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   391
  <td class="source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   392
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   393
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   394
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   395
  <a href="/annotate/853dcd4de2a6/primes.py#l18"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   396
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   397
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   398
  <td class="source"><a href="#l18" id="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="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   399
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   400
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   401
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   402
  <a href="/annotate/853dcd4de2a6/primes.py#l19"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   403
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   404
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   405
  <td class="source"><a href="#l19" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   406
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   407
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   408
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   409
  <a href="/annotate/853dcd4de2a6/primes.py#l20"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   410
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   411
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   412
  <td class="source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   413
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   414
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   415
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   416
  <a href="/annotate/853dcd4de2a6/primes.py#l21"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   417
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   418
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   419
  <td class="source"><a href="#l21" id="l21">    21</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   420
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   421
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   422
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   423
  <a href="/annotate/853dcd4de2a6/primes.py#l22"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   424
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   425
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   426
  <td class="source"><a href="#l22" id="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="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   427
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   428
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   429
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   430
  <a href="/annotate/853dcd4de2a6/primes.py#l23"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   431
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   432
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   433
  <td class="source"><a href="#l23" id="l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">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="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   434
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   435
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   436
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   437
  <a href="/annotate/853dcd4de2a6/primes.py#l24"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   438
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   439
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   440
  <td class="source"><a href="#l24" id="l24">    24</a> </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   441
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   442
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   443
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   444
  <a href="/annotate/853dcd4de2a6/primes.py#l25"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   445
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   446
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   447
  <td class="source"><a href="#l25" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   448
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   449
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   450
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   451
  <a href="/annotate/853dcd4de2a6/primes.py#l26"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   452
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   453
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   454
  <td class="source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   455
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   456
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   457
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   458
  <a href="/annotate/853dcd4de2a6/primes.py#l27"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   459
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   460
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   461
  <td class="source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   462
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   463
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   464
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   465
  <a href="/annotate/853dcd4de2a6/primes.py#l28"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   466
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   467
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   468
  <td class="source"><a href="#l28" id="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="mf">1</span><span class="p">])</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   469
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   470
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   471
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   472
  <a href="/annotate/853dcd4de2a6/primes.py#l29"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   473
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   474
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   475
  <td class="source"><a href="#l29" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   476
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   477
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   478
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   479
  <a href="/annotate/853dcd4de2a6/primes.py#l30"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   480
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   481
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   482
  <td class="source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   483
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   484
  <tr class="parity0">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   485
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   486
  <a href="/annotate/853dcd4de2a6/primes.py#l31"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   487
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   488
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   489
  <td class="source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   490
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   491
  <tr class="parity1">
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   492
  <td class="annotate">
16577
f208a4e20018 paper, monoblue: link correctly to lines in annotate view
Martin Geisler <mg@aragost.com>
parents: 15446
diff changeset
   493
  <a href="/annotate/853dcd4de2a6/primes.py#l32"
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   494
  title="853dcd4de2a6: a">test@0</a>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   495
  </td>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   496
  <td class="source"><a href="#l32" id="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>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   497
  </tr>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   498
  </table>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   499
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   500
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   501
  </div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   502
  
14053
139fb11210bb fix broken tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13618
diff changeset
   503
  <script type="text/javascript">process_dates()</script>
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   504
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   505
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   506
  </body>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   507
  </html>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   508
  
6485
938319418d8c highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents: 6355
diff changeset
   509
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   510
hgweb fileannotate, raw
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   511
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   512
  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   513
  >     | sed "s/test@//" > a
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   514
  $ echo "200 Script output follows" > b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   515
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   516
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   517
  $ hg annotate "primes.py" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   518
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   519
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   520
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   521
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   522
  $ diff -u b a
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   523
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   524
hgweb filerevision, raw
6485
938319418d8c highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents: 6355
diff changeset
   525
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   526
  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   527
  >     > a
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   528
  $ echo "200 Script output follows" > b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   529
  $ echo "" >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   530
  $ hg cat primes.py >> b
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   531
  $ diff -u b a
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   532
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   533
hgweb highlightcss friendly
6485
938319418d8c highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents: 6355
diff changeset
   534
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   535
  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   536
  $ head -n 4 out
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   537
  200 Script output follows
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   538
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   539
  /* pygments_style = friendly */
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   540
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   541
  $ rm out
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   542
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   543
errors encountered
6485
938319418d8c highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents: 6355
diff changeset
   544
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   545
  $ cat errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   546
  $ "$TESTDIR/killdaemons.py"
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   547
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   548
Change the pygments style
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   549
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   550
  $ cat > .hg/hgrc <<EOF
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   551
  > [web]
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   552
  > pygments_style = fruity
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   553
  > EOF
9424
799373ff2554 highlight: fixes garbled text in non-UTF-8 environment
Yuya Nishihara <yuya@tcha.org>
parents: 8485
diff changeset
   554
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   555
hg serve again
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   556
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   557
  $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   558
  $ cat hg.pid >> $DAEMON_PIDS
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   559
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   560
hgweb highlightcss fruity
9424
799373ff2554 highlight: fixes garbled text in non-UTF-8 environment
Yuya Nishihara <yuya@tcha.org>
parents: 8485
diff changeset
   561
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   562
  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   563
  $ head -n 4 out
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   564
  200 Script output follows
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   565
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   566
  /* pygments_style = fruity */
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   567
  
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   568
  $ rm out
9424
799373ff2554 highlight: fixes garbled text in non-UTF-8 environment
Yuya Nishihara <yuya@tcha.org>
parents: 8485
diff changeset
   569
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   570
errors encountered
9424
799373ff2554 highlight: fixes garbled text in non-UTF-8 environment
Yuya Nishihara <yuya@tcha.org>
parents: 8485
diff changeset
   571
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   572
  $ cat errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   573
  $ cd ..
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   574
  $ hg init eucjp
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   575
  $ cd eucjp
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   576
  $ python -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   577
  $ hg ci -Ama
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   578
  adding eucjp.txt
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   579
  $ hgserveget () {
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   580
  >     "$TESTDIR/killdaemons.py"
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   581
  >     echo % HGENCODING="$1" hg serve
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   582
  >     HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   583
  >     cat hg.pid >> $DAEMON_PIDS
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   584
  > 
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   585
  >     echo % hgweb filerevision, html
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   586
  >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
12943
7439ea4146f8 tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents: 12680
diff changeset
   587
  >         | grep '<div class="parity0 source">'
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   588
  >     echo % errors encountered
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   589
  >     cat errors.log
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   590
  > }
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   591
  $ hgserveget euc-jp eucjp.txt
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   592
  % HGENCODING=euc-jp hg serve
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   593
  % hgweb filerevision, html
12943
7439ea4146f8 tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents: 12680
diff changeset
   594
  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xb5\xfe</div> (esc)
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   595
  % errors encountered
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   596
  $ hgserveget utf-8 eucjp.txt
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   597
  % HGENCODING=utf-8 hg serve
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   598
  % hgweb filerevision, html
12943
7439ea4146f8 tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents: 12680
diff changeset
   599
  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xef\xbf\xbd\xef\xbf\xbd</div> (esc)
12445
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   600
  % errors encountered
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   601
  $ hgserveget us-ascii eucjp.txt
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   602
  % HGENCODING=us-ascii hg serve
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   603
  % hgweb filerevision, html
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   604
  <div class="parity0 source"><a href="#l1" id="l1">     1</a> ??</div>
981ce49a243f tests: unify test-highlight
Matt Mackall <mpm@selenic.com>
parents: 10257
diff changeset
   605
  % errors encountered