From patchwork Mon Feb 19 06:02:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,2] hgweb: show each obsfateentry on its own line From: Anton Shestakov X-Patchwork-Id: 28148 Message-Id: <68315c9df7c97acbb62a.1519020160@neuro> To: mercurial-devel@mercurial-scm.org Date: Mon, 19 Feb 2018 14:02:40 +0800 # HG changeset patch # User Anton Shestakov # Date 1519015730 -28800 # Mon Feb 19 12:48:50 2018 +0800 # Node ID 68315c9df7c97acbb62a0a8bb23412e68eb67947 # Parent 29f9eeec6782d2815cf742d22286b0192fc3c14a hgweb: show each obsfateentry on its own line Commits with more than one reason for being obsolete used to just show obsfate entries all on one line, and that doesn't look good. Let's show each entry on its own line. In paper and coal the lines are simply split using a
element, and in other hgweb themes each entry has its own table header. This is done by analogy with changeset parents and children -- in paper and coal they are all put into one table row, and everywhere else each one gets a separate row. diff --git a/mercurial/templates/gitweb/changeset.tmpl b/mercurial/templates/gitweb/changeset.tmpl --- a/mercurial/templates/gitweb/changeset.tmpl +++ b/mercurial/templates/gitweb/changeset.tmpl @@ -44,7 +44,7 @@ changeset | changeset {rev} {node|short} -{if(obsolete, 'obsolete{succsandmarkers%obsfateentry}')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} {child%changesetchild} diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map +++ b/mercurial/templates/gitweb/map @@ -277,7 +277,11 @@ obsfateverb = '{obsfateverb(successors, obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' +obsfateentry = ' + + obsolete + {obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate} + ' shortlogentry = ' {date|rfc822date} diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl --- a/mercurial/templates/monoblue/changeset.tmpl +++ b/mercurial/templates/monoblue/changeset.tmpl @@ -48,7 +48,7 @@ {branch%changesetbranch}
changeset {rev}
{node|short}
- {if(obsolete, '
obsolete
{succsandmarkers%obsfateentry}
')} + {if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} {child%changesetchild} diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map +++ b/mercurial/templates/monoblue/map @@ -235,7 +235,9 @@ obsfateverb = '{obsfateverb(successors, obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' +obsfateentry = ' +
obsolete
+
{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}
' shortlogentry = ' {date|rfc822date} diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl +++ b/mercurial/templates/paper/changeset.tmpl @@ -51,7 +51,7 @@ {if(obsolete, ' obsolete - {succsandmarkers%obsfateentry} + {join(succsandmarkers%obsfateentry, '
\n')} ')} parents diff --git a/mercurial/templates/spartan/changelogentry.tmpl b/mercurial/templates/spartan/changelogentry.tmpl --- a/mercurial/templates/spartan/changelogentry.tmpl +++ b/mercurial/templates/spartan/changelogentry.tmpl @@ -22,10 +22,7 @@ phase: {phase|escape} ')} - {if(obsolete, ' - obsolete: - {succsandmarkers%obsfateentry} - ')} + {if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(instabilities), '0', '', ' instabilities: {instabilities%"{instability} "|escape} diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl +++ b/mercurial/templates/spartan/changeset.tmpl @@ -37,10 +37,7 @@ phase: {phase|escape} ')} -{if(obsolete, ' - obsolete: - {succsandmarkers%obsfateentry} -')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(instabilities), '0', '', ' instabilities: {instabilities%"{instability} "|escape} diff --git a/mercurial/templates/spartan/map b/mercurial/templates/spartan/map --- a/mercurial/templates/spartan/map +++ b/mercurial/templates/spartan/map @@ -172,7 +172,11 @@ obsfateverb = '{obsfateverb(successors, obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' +obsfateentry = ' + + obsolete: + {obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate} + ' filediffparent = ' parent {rev}: diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t --- a/tests/test-obsolete-divergent.t +++ b/tests/test-obsolete-divergent.t @@ -630,15 +630,20 @@ fix the divergence check an obsolete changeset that was rewritten and also split $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=paper' | egrep 'rewritten|split' - rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 + rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000
+ split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=coal' | egrep 'rewritten|split' - rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 + rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000
+ split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=gitweb' | egrep 'rewritten|split' - obsoleterewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 + rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000 + split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=monoblue' | egrep 'rewritten|split' -
obsolete
rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000
+
rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000
+
split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000
$ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=spartan' | egrep 'rewritten|split' - rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 + rewritten as bed64f5d2f5a by test Thu, 01 Jan 1970 00:00:00 +0000 + split as 7ae126973a96 14608b260df8 by test Thu, 01 Jan 1970 00:00:00 +0000 $ killdaemons.py diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1049,8 +1049,8 @@ check obsolete changeset $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=monoblue' | grep '' draft obsolete $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=spartan' | grep 'class="obsolete"' - obsolete: - pruned by test Thu, 01 Jan 1970 00:00:00 +0000 + obsolete: + pruned by test Thu, 01 Jan 1970 00:00:00 +0000 check changeset with instabilities