# HG changeset patch # User Anton Shestakov # Date 1510761309 -28800 # Node ID 9acc0360ff67c35d18e20c401aa4c801c7bea339 # Parent 52790352dd05b6138330badfa42ae31a333555a6 hgweb: move changeset "tags" to a template in map file (paper and coal) This patch puts all these changeset "tags" into one template shared everywhere in paper and coal themes. But it should be noted that some of the templates had different sets of tags, in some cases it was intended, in others - most likely not. First, what's up with all these different ways to get changeset's branch. There are actually 3 ways to do it in hgweb, they can all be seen in this patch; "branches", "inbranch" and "branch". They are all lists that consist of 1 or 0 items: - "branches" has ctx.branch() if current changeset is the tip of that branch - "inbranch" has ctx.branch() if current changeset is _not_ the tip of that branch and the branch is not "default" - "branch" aka "changesetbranch" has ctx.branch() if the branch is not "default" The majority of cases (7 vs 2 + /graph) in paper theme used only option 3, which meant that "default" was never displayed. But other parts of the theme disagreed with this and used option 1 and option 2 together. For example, the default view (log) displays "default" on the branch tip (can be seen right about now on m-s.o/repo/hg), but it disappears when you click on the commit. Also, using option 3 alone meant that there was no way to tell if a changeset is the tip of its branch or not (it was always assumed that it's not, see how some css classes change from "branchname" to the correct "branchhead" in tests) -- so the two different css styles that exist in paper just for this were underused. I think this patch improves the situation, even though it changes the old (even if inconsistent) behavior. The new behavior matches that of gitweb and monoblue. diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/changeset.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -33,7 +33,7 @@

changeset {rev}:{node|short} - {changesetbranch%changelogbranchname}{changesettag}{changesetbookmark} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/fileannotate.tmpl --- a/mercurial/templates/paper/fileannotate.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/fileannotate.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -39,7 +39,7 @@

annotate {file|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/filecomparison.tmpl --- a/mercurial/templates/paper/filecomparison.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/filecomparison.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -38,7 +38,7 @@

comparison {file|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/filediff.tmpl --- a/mercurial/templates/paper/filediff.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/filediff.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -38,7 +38,7 @@

diff {file|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/filelog.tmpl --- a/mercurial/templates/paper/filelog.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/filelog.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -46,7 +46,7 @@

log {file|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags} {if(linerange, ' (following lines {linerange}{if(descend, ', descending')} back to filelog)')}

diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/filelogentry.tmpl --- a/mercurial/templates/paper/filelogentry.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/filelogentry.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -3,7 +3,7 @@ {author|person} {desc|strip|firstline|escape|nonempty} - {inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}{rename%filelogrename} + {alltags}{rename%filelogrename} {if(patch, '{diff}')} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/filerevision.tmpl --- a/mercurial/templates/paper/filerevision.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/filerevision.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -38,7 +38,7 @@

view {file|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/manifest.tmpl --- a/mercurial/templates/paper/manifest.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/manifest.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -32,7 +32,7 @@

directory {path|escape} @ {rev}:{node|short} - {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag} + {alltags}

{searchform} diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/map --- a/mercurial/templates/paper/map Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/map Wed Nov 15 23:55:09 2017 +0800 @@ -203,6 +203,7 @@ changesetbookmark = '{bookmark|escape} ' changelogbranchhead = '{name|escape} ' changelogbranchname = '{name|escape} ' +alltags = '{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag}' filediffparent = ' diff -r 52790352dd05 -r 9acc0360ff67 mercurial/templates/paper/shortlogentry.tmpl --- a/mercurial/templates/paper/shortlogentry.tmpl Fri Nov 03 21:01:20 2017 +0100 +++ b/mercurial/templates/paper/shortlogentry.tmpl Wed Nov 15 23:55:09 2017 +0800 @@ -3,6 +3,6 @@ {author|person} {desc|strip|firstline|escape|nonempty} - {inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{bookmarks%changelogtag} + {alltags} diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb-commands.t Wed Nov 15 23:55:09 2017 +0800 @@ -1312,7 +1312,7 @@

view foo @ 1:a4f92ed23982 - + default

@@ -1446,7 +1446,7 @@

view foo @ 2:1d22e65f027e - stable + stable

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb-descend-empties.t Wed Nov 15 23:55:09 2017 +0800 @@ -73,7 +73,7 @@

directory / @ 0:c9f45f7a1659 - tip + default tip

@@ -193,7 +193,7 @@

directory / @ 0:c9f45f7a1659 - tip + default tip

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb-diffs.t Wed Nov 15 23:55:09 2017 +0800 @@ -254,7 +254,7 @@

diff b @ 1:559edbd9ed20 - tip + default tip

@@ -536,7 +536,7 @@

diff a @ 1:559edbd9ed20 - tip + default tip

@@ -772,7 +772,7 @@

comparison a @ 2:d73db4d812ff - tip + default tip

@@ -904,7 +904,7 @@

comparison a @ 3:20e80271eb7a - tip + default tip

@@ -1042,7 +1042,7 @@

comparison e @ 5:41d9fc4a6ae1 - tip + default tip

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb-filelog.t --- a/tests/test-hgweb-filelog.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb-filelog.t Wed Nov 15 23:55:09 2017 +0800 @@ -740,7 +740,7 @@

log c @ 7:46c1a66bd8fc - a-branch tip + a-branch tip (following lines 1:2 back to filelog)

@@ -860,7 +860,7 @@

log c @ 7:46c1a66bd8fc - a-branch tip + a-branch tip (following lines 1:2 back to filelog)

@@ -1379,7 +1379,7 @@

log c @ 12:6e4182052f7b - a-branch tip + a-branch tip (following lines 3:4 back to filelog)

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb-removed.t --- a/tests/test-hgweb-removed.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb-removed.t Wed Nov 15 23:55:09 2017 +0800 @@ -62,7 +62,7 @@

changeset 1:c78f6c5cbea9 - tip + default tip

@@ -190,7 +190,7 @@

diff a @ 1:c78f6c5cbea9 - tip + default tip

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-hgweb.t --- a/tests/test-hgweb.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-hgweb.t Wed Nov 15 23:55:09 2017 +0800 @@ -267,7 +267,7 @@

directory / @ 0:2ef0ac749a14 - tip @ a b c d/e/f + default tip @ a b c d/e/f

diff -r 52790352dd05 -r 9acc0360ff67 tests/test-highlight.t --- a/tests/test-highlight.t Fri Nov 03 21:01:20 2017 +0100 +++ b/tests/test-highlight.t Wed Nov 15 23:55:09 2017 +0800 @@ -113,7 +113,7 @@

view primes.py @ 0:f4fca47b67e6 - tip + default tip

@@ -252,7 +252,7 @@

annotate primes.py @ 0:f4fca47b67e6 - tip + default tip