# HG changeset patch # User Anton Shestakov # Date 1519015730 -28800 # Node ID f3fd4fe0506fa02c43c8e624dbd47d8481cb0549 # Parent ef7b48e6388d57a7c2d9b6626d9d0dda7db41b51 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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/gitweb/changeset.tmpl --- a/mercurial/templates/gitweb/changeset.tmpl Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/gitweb/changeset.tmpl Mon Feb 19 12:48:50 2018 +0800 @@ -44,7 +44,7 @@ changeset {rev} {node|short} -{if(obsolete, 'obsolete{succsandmarkers%obsfateentry}')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} {child%changesetchild} diff -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/gitweb/map Mon Feb 19 12:48:50 2018 +0800 @@ -277,7 +277,11 @@ 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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/monoblue/changeset.tmpl --- a/mercurial/templates/monoblue/changeset.tmpl Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/monoblue/changeset.tmpl Mon Feb 19 12:48:50 2018 +0800 @@ -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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/monoblue/map Mon Feb 19 12:48:50 2018 +0800 @@ -235,7 +235,9 @@ 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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/paper/changeset.tmpl Mon Feb 19 12:48:50 2018 +0800 @@ -51,7 +51,7 @@ {if(obsolete, ' obsolete - {succsandmarkers%obsfateentry} + {join(succsandmarkers%obsfateentry, '
\n')} ')} parents diff -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/spartan/changelogentry.tmpl --- a/mercurial/templates/spartan/changelogentry.tmpl Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/spartan/changelogentry.tmpl Mon Feb 19 12:48:50 2018 +0800 @@ -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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/spartan/changeset.tmpl Mon Feb 19 12:48:50 2018 +0800 @@ -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 -r ef7b48e6388d -r f3fd4fe0506f mercurial/templates/spartan/map --- a/mercurial/templates/spartan/map Mon Feb 19 12:30:23 2018 +0800 +++ b/mercurial/templates/spartan/map Mon Feb 19 12:48:50 2018 +0800 @@ -172,7 +172,11 @@ 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 -r ef7b48e6388d -r f3fd4fe0506f tests/test-obsolete-divergent.t --- a/tests/test-obsolete-divergent.t Mon Feb 19 12:30:23 2018 +0800 +++ b/tests/test-obsolete-divergent.t Mon Feb 19 12:48:50 2018 +0800 @@ -630,15 +630,20 @@ 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 -r ef7b48e6388d -r f3fd4fe0506f tests/test-obsolete.t --- a/tests/test-obsolete.t Mon Feb 19 12:30:23 2018 +0800 +++ b/tests/test-obsolete.t Mon Feb 19 12:48:50 2018 +0800 @@ -1049,8 +1049,8 @@ $ 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