diff tests/test-obsolete.t @ 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 4441705b7111
children 4c7ae95e1c71
line wrap: on
line diff
--- a/tests/test-obsolete.t	Sat Dec 16 18:58:02 2017 -0500
+++ b/tests/test-obsolete.t	Tue Nov 21 17:03:41 2017 +0800
@@ -1032,7 +1032,19 @@
           <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="obsoletetag" title="obsolete">obsolete</span> </span>
   $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=spartan' | grep 'class="obsolete"'
     <th class="obsolete">obsolete:</th>
-    <td class="obsolete">yes</td>
+    <td class="obsolete">pruned</td>
+
+check an obsolete changeset that has been rewritten
+  $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=paper' | grep rewritten
+   <td>rewritten as 6:3de5eca88c00</td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=coal' | grep rewritten
+   <td>rewritten as 6:3de5eca88c00</td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=gitweb' | grep rewritten
+  <tr><td>obsolete</td><td>rewritten as 6:3de5eca88c00</td></tr>
+  $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=monoblue' | grep rewritten
+          <dt>obsolete</dt><dd>rewritten as 6:3de5eca88c00</dd>
+  $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=spartan' | grep rewritten
+   <td class="obsolete">rewritten as 6:3de5eca88c00</td>
 
 check changeset with instabilities