comparison mercurial/templates/monoblue/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 e397f8585953
children f3fd4fe0506f
comparison
equal deleted inserted replaced
35484:1853c8677160 35485:1721ce06100a
46 <dt>date</dt> 46 <dt>date</dt>
47 <dd class="date age">{date|rfc822date}</dd> 47 <dd class="date age">{date|rfc822date}</dd>
48 {branch%changesetbranch} 48 {branch%changesetbranch}
49 <dt>changeset {rev}</dt> 49 <dt>changeset {rev}</dt>
50 <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd> 50 <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
51 {if(obsolete, '<dt>obsolete</dt><dd>{succsandmarkers%obsfateentry}</dd>')}
51 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} 52 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
52 {child%changesetchild} 53 {child%changesetchild}
53 </dl> 54 </dl>
54 55
55 <p class="description">{desc|strip|escape|websub|addbreaks|nonempty}</p> 56 <p class="description">{desc|strip|escape|websub|addbreaks|nonempty}</p>