Mercurial > hg
annotate mercurial/templates/spartan/changeset.tmpl @ 35485:1721ce06100a
hgweb: display fate of obsolete changesets
Operations that obsolete changesets store enough metadata to explain what
happened after the fact. One way to get that metadata is showsuccsandmarkers
function, which returns a list of successors of a particular changeset and
appropriate obsolescence markers.
Templates have a set of experimental functions that have names starting with
obsfate. This patch uses some of these functions to interpret output of
succsandmarkers() and produce human-friendly messages that describe what
happened to an obsolete changeset, e.g. "pruned" or "rewritten as
6:3de5eca88c00".
In commonentry(), succsandmarkers property is made callable so it's only
executed on demand; this saves time when changeset is not obsolete, and also in
e.g. /shortlog view, where there are a lot of changesets, but we don't need to
show each and every one in detail.
In spartan theme, succsandmarkers is used instead of the simple "obsolete:
yes", in other themes a new line is added to /rev page.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 21 Nov 2017 17:03:41 +0800 |
parents | f38c91c74294 |
children | f3fd4fe0506f |
rev | line source |
---|---|
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
1 {header} |
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
2 <title>{repo|escape}: changeset {node|short}</title> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 </head> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 <body> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 <div class="buttons"> |
25603
1cac419ab831
hgweb: don't dereference symbolic revision in spartan style
Anton Shestakov <av6@dwimlabs.net>
parents:
23740
diff
changeset
|
7 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a> |
1cac419ab831
hgweb: don't dereference symbolic revision in spartan style
Anton Shestakov <av6@dwimlabs.net>
parents:
23740
diff
changeset
|
8 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a> |
25794
902148444889
spartan: don't drop current revision in log/graph links
Anton Shestakov <av6@dwimlabs.net>
parents:
25603
diff
changeset
|
9 <a href="{url|urlescape}graph/{symrev}{sessionvars%urlparameter}">graph</a> |
18526
9409aeaafdc1
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents:
18259
diff
changeset
|
10 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
9409aeaafdc1
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents:
18259
diff
changeset
|
11 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
25603
1cac419ab831
hgweb: don't dereference symbolic revision in spartan style
Anton Shestakov <av6@dwimlabs.net>
parents:
23740
diff
changeset
|
12 <a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a> |
1cac419ab831
hgweb: don't dereference symbolic revision in spartan style
Anton Shestakov <av6@dwimlabs.net>
parents:
23740
diff
changeset
|
13 <a href="{url|urlescape}raw-rev/{symrev}">raw</a> |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
14 {archives%archiveentry} |
18526
9409aeaafdc1
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents:
18259
diff
changeset
|
15 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
16 </div> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
17 |
18259
7bf412b767fe
hgweb, spartan: add "URL breadcrumbs"
Angel Ezquerra <angel.ezquerra at gmail.com>
parents:
15375
diff
changeset
|
18 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset: {desc|strip|escape|firstline|nonempty}</h2> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
19 |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
20 <table id="changesetEntry"> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
21 <tr> |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
22 <th class="changeset">changeset {rev}:</th> |
18526
9409aeaafdc1
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents:
18259
diff
changeset
|
23 <td class="changeset"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
24 </tr> |
23740
9e1f4c65f5f5
hgweb: allow viewing diffs against p1 or p2 for merge commits (issue3904)
Anton Shestakov <engored@ya.ru>
parents:
18628
diff
changeset
|
25 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
26 {child%changesetchild} |
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
27 {changesettag} |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
28 <tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
29 <th class="author">author:</th> |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
30 <td class="author">{author|obfuscate}</td> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
31 </tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
32 <tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
33 <th class="date">date:</th> |
15375
fe9d36a6853e
hgweb: fix dynamic date calculation not working under Safari
Brodie Rao <brodie@bitheap.org>
parents:
14046
diff
changeset
|
34 <td class="date age">{date|rfc822date}</td> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
35 </tr> |
35065
a1de4ffaa7a8
hgweb: show commit phase if it's not public
Anton Shestakov <av6@dwimlabs.net>
parents:
25794
diff
changeset
|
36 {ifeq(phase, 'public', '', '<tr> |
a1de4ffaa7a8
hgweb: show commit phase if it's not public
Anton Shestakov <av6@dwimlabs.net>
parents:
25794
diff
changeset
|
37 <th class="phase">phase:</th> |
a1de4ffaa7a8
hgweb: show commit phase if it's not public
Anton Shestakov <av6@dwimlabs.net>
parents:
25794
diff
changeset
|
38 <td class="phase">{phase|escape}</td> |
a1de4ffaa7a8
hgweb: show commit phase if it's not public
Anton Shestakov <av6@dwimlabs.net>
parents:
25794
diff
changeset
|
39 </tr>')} |
35089
69ea10d5b00c
hgweb: show obsolescence status of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35065
diff
changeset
|
40 {if(obsolete, '<tr> |
69ea10d5b00c
hgweb: show obsolescence status of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35065
diff
changeset
|
41 <th class="obsolete">obsolete:</th> |
35485
1721ce06100a
hgweb: display fate of obsolete changesets
Anton Shestakov <av6@dwimlabs.net>
parents:
35131
diff
changeset
|
42 <td class="obsolete">{succsandmarkers%obsfateentry}</td> |
35089
69ea10d5b00c
hgweb: show obsolescence status of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35065
diff
changeset
|
43 </tr>')} |
35094
38fe3fe4bbb6
hgweb: show instabilities of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35089
diff
changeset
|
44 {ifeq(count(instabilities), '0', '', '<tr> |
38fe3fe4bbb6
hgweb: show instabilities of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35089
diff
changeset
|
45 <th class="instabilities">instabilities:</th> |
35131
f38c91c74294
hgweb: rename the main attribute of instabilities
Anton Shestakov <av6@dwimlabs.net>
parents:
35094
diff
changeset
|
46 <td class="instabilities">{instabilities%"{instability} "|escape}</td> |
35094
38fe3fe4bbb6
hgweb: show instabilities of a commit
Anton Shestakov <av6@dwimlabs.net>
parents:
35089
diff
changeset
|
47 </tr>')} |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
48 <tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
49 <th class="files">files:</th> |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
50 <td class="files">{files}</td> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
51 </tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
52 <tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
53 <th class="description">description:</th> |
18628
52305554fd6e
hgweb: apply the websub filter to revision descriptions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
18526
diff
changeset
|
54 <td class="description">{desc|strip|escape|websub|addbreaks|nonempty}</td> |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
55 </tr> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
56 </table> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
57 |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
58 <div id="changesetDiff"> |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
59 {diff} |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
60 </div> |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
61 |
8431
5c1aabc58004
spartan: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8357
diff
changeset
|
62 {footer} |
7338
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
63 |
fecfe4392e94
hgweb: move old style to spartan/
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
64 |