changeset 37024:7c18798fc24d

hgweb: explain instabilities of unstable changesets (the rest of the themes)
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 20 Mar 2018 14:19:28 +0800
parents 6bc2f1b3bc9d
children 0782ac132a41
files mercurial/templates/gitweb/changeset.tmpl mercurial/templates/gitweb/map mercurial/templates/monoblue/changeset.tmpl mercurial/templates/monoblue/map mercurial/templates/spartan/changelogentry.tmpl mercurial/templates/spartan/changeset.tmpl mercurial/templates/spartan/map tests/test-obsolete-divergent.t tests/test-obsolete.t
diffstat 9 files changed, 43 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/gitweb/changeset.tmpl	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/gitweb/changeset.tmpl	Tue Mar 20 14:19:28 2018 +0800
@@ -45,6 +45,7 @@
  <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
 </tr>
 {if(obsolete, succsandmarkers%obsfateentry)}
+{if(instabilities, whyunstable%whyunstableentry)}
 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
 {child%changesetchild}
 </table></div>
--- a/mercurial/templates/gitweb/map	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/gitweb/map	Tue Mar 20 14:19:28 2018 +0800
@@ -282,6 +282,13 @@
     <td>obsolete</td>
     <td>{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}</td>
   </tr>'
+instabilitychangesetlink = '<a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  <tr>
+    <td>unstable</td>
+    <td>{instability}: {if(divergentnodes, divergentnodes%divergentnode)} {reason} {instabilitychangesetlink}</td>
+  </tr>'
 shortlogentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
--- a/mercurial/templates/monoblue/changeset.tmpl	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/monoblue/changeset.tmpl	Tue Mar 20 14:19:28 2018 +0800
@@ -49,6 +49,7 @@
         <dt>changeset {rev}</dt>
         <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {if(obsolete, succsandmarkers%obsfateentry)}
+        {if(instabilities, whyunstable%whyunstableentry)}
         {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
         {child%changesetchild}
     </dl>
--- a/mercurial/templates/monoblue/map	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/monoblue/map	Tue Mar 20 14:19:28 2018 +0800
@@ -238,6 +238,11 @@
 obsfateentry = '
   <dt>obsolete</dt>
   <dd>{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}</dd>'
+instabilitychangesetlink = '<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  <dt>unstable</dt>
+  <dd>{instability}: {if(divergentnodes, divergentnodes%divergentnode)} {reason} {instabilitychangesetlink}</dd>'
 shortlogentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
--- a/mercurial/templates/spartan/changelogentry.tmpl	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/spartan/changelogentry.tmpl	Tue Mar 20 14:19:28 2018 +0800
@@ -23,10 +23,7 @@
   <td class="phase">{phase|escape}</td>
  </tr>')}
  {if(obsolete, succsandmarkers%obsfateentry)}
- {ifeq(count(instabilities), '0', '', '<tr>
-  <th class="instabilities">instabilities:</th>
-  <td class="instabilities">{instabilities%"{instability} "|escape}</td>
- </tr>')}
+ {if(instabilities, whyunstable%whyunstableentry)}
  <tr>
   <th class="files"><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>:</th>
   <td class="files">{files}</td>
--- a/mercurial/templates/spartan/changeset.tmpl	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/spartan/changeset.tmpl	Tue Mar 20 14:19:28 2018 +0800
@@ -38,10 +38,7 @@
  <td class="phase">{phase|escape}</td>
 </tr>')}
 {if(obsolete, succsandmarkers%obsfateentry)}
-{ifeq(count(instabilities), '0', '', '<tr>
- <th class="instabilities">instabilities:</th>
- <td class="instabilities">{instabilities%"{instability} "|escape}</td>
-</tr>')}
+{if(instabilities, whyunstable%whyunstableentry)}
 <tr>
  <th class="files">files:</th>
  <td class="files">{files}</td>
--- a/mercurial/templates/spartan/map	Tue Mar 20 21:10:29 2018 -0400
+++ b/mercurial/templates/spartan/map	Tue Mar 20 14:19:28 2018 +0800
@@ -177,6 +177,13 @@
     <th class="obsolete">obsolete:</th>
     <td class="obsolete">{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}</td>
   </tr>'
+instabilitychangesetlink = '<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  <tr>
+    <th class="unstable">unstable:</th>
+    <td class="unstable">{instability}: {if(divergentnodes, divergentnodes%divergentnode)} {reason} {instabilitychangesetlink}</td>
+  </tr>'
 filediffparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
--- a/tests/test-obsolete-divergent.t	Tue Mar 20 21:10:29 2018 -0400
+++ b/tests/test-obsolete-divergent.t	Tue Mar 20 14:19:28 2018 +0800
@@ -732,6 +732,12 @@
    <td>content-divergent: <a href="/rev/70d5a63ca112?style=paper">70d5a63ca112</a> (draft) predecessor <a href="/rev/a178212c3433?style=paper">a178212c3433</a></td>
   $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=coal' | grep divergent:
    <td>content-divergent: <a href="/rev/70d5a63ca112?style=coal">70d5a63ca112</a> (draft) predecessor <a href="/rev/a178212c3433?style=coal">a178212c3433</a></td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=gitweb' | grep divergent:
+  <td>content-divergent: <a class="list" href="/rev/70d5a63ca112?style=gitweb">70d5a63ca112</a> (draft) predecessor <a class="list" href="/rev/a178212c3433?style=gitweb">a178212c3433</a></td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=monoblue' | grep divergent:
+  <dd>content-divergent: <a href="/rev/70d5a63ca112?style=monoblue">70d5a63ca112</a> (draft) predecessor <a href="/rev/a178212c3433?style=monoblue">a178212c3433</a></dd>
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=spartan' | grep divergent:
+  <td class="unstable">content-divergent: <a href="/rev/70d5a63ca112?style=spartan">70d5a63ca112</a> (draft) predecessor <a href="/rev/a178212c3433?style=spartan">a178212c3433</a></td>
 
   $ killdaemons.py
 
--- a/tests/test-obsolete.t	Tue Mar 20 21:10:29 2018 -0400
+++ b/tests/test-obsolete.t	Tue Mar 20 14:19:28 2018 +0800
@@ -1068,9 +1068,11 @@
     <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
   $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=monoblue' | grep '<span class="logtags">'
           <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
-  $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=spartan' | grep 'class="instabilities"'
-    <th class="instabilities">instabilities:</th>
-    <td class="instabilities">orphan phase-divergent </td>
+  $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=spartan' | grep 'class="unstable"'
+  <th class="unstable">unstable:</th>
+  <td class="unstable">orphan:  obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
+  <th class="unstable">unstable:</th>
+  <td class="unstable">phase-divergent:  immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
 
 check explanation for an orphan and phase-divergent changeset
 
@@ -1080,6 +1082,15 @@
   $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=coal' | egrep '(orphan|phase-divergent):'
    <td>orphan:  obsolete parent <a href="/rev/3de5eca88c00?style=coal">3de5eca88c00</a><br>
   phase-divergent:  immutable predecessor <a href="/rev/245bde4270cd?style=coal">245bde4270cd</a></td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=gitweb' | egrep '(orphan|phase-divergent):'
+  <td>orphan:  obsolete parent <a class="list" href="/rev/3de5eca88c00?style=gitweb">3de5eca88c00</a></td>
+  <td>phase-divergent:  immutable predecessor <a class="list" href="/rev/245bde4270cd?style=gitweb">245bde4270cd</a></td>
+  $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=monoblue' | egrep '(orphan|phase-divergent):'
+  <dd>orphan:  obsolete parent <a href="/rev/3de5eca88c00?style=monoblue">3de5eca88c00</a></dd>
+  <dd>phase-divergent:  immutable predecessor <a href="/rev/245bde4270cd?style=monoblue">245bde4270cd</a></dd>
+  $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=spartan' | egrep '(orphan|phase-divergent):'
+  <td class="unstable">orphan:  obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
+  <td class="unstable">phase-divergent:  immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
 
   $ killdaemons.py