# HG changeset patch # User Anton Shestakov # Date 1511071370 -28800 # Node ID 38fe3fe4bbb639d8bc082c5710ace24cb6f86375 # Parent bd2743936b56e2ff33dc59bb0baaf981c21754d9 hgweb: show instabilities of a commit In paper, coal, gitweb and monoblue a new "tag" (or multiple, if there are many instabilities) is added to the same line that has phase, branch, etc of a changeset; in gitweb and monoblue this element has a light red background, in paper and coal the element is black and underlined. In spartan theme instabilities are shown on a separate line. While test-obsolete.t uses first(phasedivergent()) revset to pick a changeset to test, that particular changeset is also an orphan, so two different instability tags are displayed. diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/gitweb/map Sun Nov 19 14:02:50 2017 +0800 @@ -264,11 +264,12 @@ graph = graph.tmpl phasetag = '{ifeq(phase, 'public', '', '{phase|escape} ')}' obsoletetag = '{if(obsolete, 'obsolete ')}' +instabilitytag = '{name|escape} ' tagtag = '{name|escape} ' branchtag = '{name|escape} ' inbranchtag = '{name|escape} ' bookmarktag = '{name|escape} ' -alltags = '{phasetag}{obsoletetag}{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}' +alltags = '{phasetag}{obsoletetag}{instabilities%instabilitytag}{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}' shortlogentry = ' {date|rfc822date} diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/monoblue/map Sun Nov 19 14:02:50 2017 +0800 @@ -223,11 +223,12 @@ shortlog = shortlog.tmpl phasetag = '{ifeq(phase, 'public', '', '{phase|escape} ')}' obsoletetag = '{if(obsolete, 'obsolete ')}' +instabilitytag = '{name|escape} ' tagtag = '{name|escape} ' branchtag = '{name|escape} ' inbranchtag = '{name|escape} ' bookmarktag = '{name|escape} ' -alltags = '{phasetag}{obsoletetag}{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}' +alltags = '{phasetag}{obsoletetag}{instabilities%instabilitytag}{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}' shortlogentry = ' {date|rfc822date} diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/paper/map --- a/mercurial/templates/paper/map Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/paper/map Sun Nov 19 14:02:50 2017 +0800 @@ -200,12 +200,13 @@ ' phasetag = '{ifeq(phase, 'public', '', '{phase|escape} ')}' obsoletetag = '{if(obsolete, 'obsolete ')}' +instabilitytag = '{name|escape} ' changelogtag = '{name|escape} ' changesettag = '{tag|escape} ' changesetbookmark = '{bookmark|escape} ' changelogbranchhead = '{name|escape} ' changelogbranchname = '{name|escape} ' -alltags = '{phasetag}{obsoletetag}{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}' +alltags = '{phasetag}{obsoletetag}{instabilities%instabilitytag}{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}' filediffparent = ' diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/spartan/changelogentry.tmpl --- a/mercurial/templates/spartan/changelogentry.tmpl Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/spartan/changelogentry.tmpl Sun Nov 19 14:02:50 2017 +0800 @@ -26,6 +26,10 @@ obsolete: yes ')} + {ifeq(count(instabilities), '0', '', ' + instabilities: + {instabilities%"{name} "|escape} + ')} files: {files} diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/spartan/changeset.tmpl Sun Nov 19 14:02:50 2017 +0800 @@ -41,6 +41,10 @@ obsolete: yes ')} +{ifeq(count(instabilities), '0', '', ' + instabilities: + {instabilities%"{name} "|escape} +')} files: {files} diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/static/style-gitweb.css --- a/mercurial/templates/static/style-gitweb.css Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/static/style-gitweb.css Sun Nov 19 14:02:50 2017 +0800 @@ -130,6 +130,10 @@ background-color: #dddddd; border-color: #e4e4e4 #a3a3a3 #a3a3a3 #e4e4e4; } +span.logtags span.instabilitytag { + background-color: #ffb1c0; + border-color: #ffbbc8 #ff4476 #ff4476 #ffbbc8; +} span.logtags span.tagtag { background-color: #ffffaa; border-color: #ffffcc #ffee00 #ffee00 #ffffcc; diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/static/style-monoblue.css --- a/mercurial/templates/static/style-monoblue.css Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/static/style-monoblue.css Sun Nov 19 14:02:50 2017 +0800 @@ -241,6 +241,10 @@ background-color: #dddddd; border-color: #e4e4e4 #a3a3a3 #a3a3a3 #e4e4e4; } +span.logtags span.instabilitytag { + background-color: #ffb1c0; + border-color: #ffbbc8 #ff4476 #ff4476 #ffbbc8; +} span.logtags span.tagtag { background-color: #ffffaa; border-color: #ffffcc #ffee00 #ffee00 #ffffcc; diff -r bd2743936b56 -r 38fe3fe4bbb6 mercurial/templates/static/style-paper.css --- a/mercurial/templates/static/style-paper.css Sun Nov 19 13:18:54 2017 +0800 +++ b/mercurial/templates/static/style-paper.css Sun Nov 19 14:02:50 2017 +0800 @@ -155,6 +155,15 @@ vertical-align: baseline; } +.instability { + color: #000; + font-size: 70%; + border-bottom: 1px solid #000; + font-weight: normal; + margin-left: .5em; + vertical-align: baseline; +} + .tag { color: #999; font-size: 70%; diff -r bd2743936b56 -r 38fe3fe4bbb6 tests/test-hgweb.t --- a/tests/test-hgweb.t Sun Nov 19 13:18:54 2017 +0800 +++ b/tests/test-hgweb.t Sun Nov 19 14:02:50 2017 +0800 @@ -340,7 +340,7 @@ $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server 200 Script output follows - content-length: 9261 + content-length: 9374 content-type: text/css body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; } @@ -475,6 +475,10 @@ background-color: #dddddd; border-color: #e4e4e4 #a3a3a3 #a3a3a3 #e4e4e4; } + span.logtags span.instabilitytag { + background-color: #ffb1c0; + border-color: #ffbbc8 #ff4476 #ff4476 #ffbbc8; + } span.logtags span.tagtag { background-color: #ffffaa; border-color: #ffffcc #ffee00 #ffee00 #ffffcc; diff -r bd2743936b56 -r 38fe3fe4bbb6 tests/test-obsolete.t --- a/tests/test-obsolete.t Sun Nov 19 13:18:54 2017 +0800 +++ b/tests/test-obsolete.t Sun Nov 19 14:02:50 2017 +0800 @@ -1034,6 +1034,20 @@ obsolete: yes +check changeset with instabilities + + $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=paper' | grep '' + draft orphan phase-divergent + $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=coal' | grep '' + draft orphan phase-divergent + $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=gitweb' | grep '' + draft orphan phase-divergent + $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=monoblue' | grep '' + draft orphan phase-divergent + $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=spartan' | grep 'class="instabilities"' + instabilities: + orphan phase-divergent + $ killdaemons.py $ rm hg.pid access.log errors.log