hgmo: rename "buglink" to "mozlink" (
bug 1328717); r?wlach
The filter no longer links to just Bugzilla: it now links to many
things. So the name "buglink" is no longer appropriate. Plus,
Mercurial has a built-in "buglink" special variable in extensions,
that makes searching for occurrences of the filter harder than it
should be.
Rename the filter to "mozlink" for clarity.
MozReview-Commit-ID: 8PGxMidlkeb
--- a/hgext/hgmo/__init__.py
+++ b/hgext/hgmo/__init__.py
@@ -116,19 +116,19 @@ import mozhg.mozbuildinfo as mozbuildinf
minimumhgversion = '4.0'
testedwith = '4.0'
cmdtable = {}
command = cmdutil.command(cmdtable)
-@templatefilters.templatefilter('buglink')
-def buglink(text):
- """Any text. Hyperlink to Bugzilla."""
+@templatefilters.templatefilter('mozlink')
+def mozlink(text):
+ """Any text. Hyperlink to Bugzilla and other detected things."""
return commitparser.add_hyperlinks(text)
def addmetadata(repo, ctx, d, onlycheap=False):
"""Add changeset metadata for hgweb templates."""
description = encoding.fromlocal(ctx.description())
d['bugs'] = []
rename from hgext/hgmo/tests/test-buglink.t
rename to hgext/hgmo/tests/test-mozlink.t
--- a/hgext/hgmo/tests/test-buglink.t
+++ b/hgext/hgmo/tests/test-mozlink.t
@@ -19,17 +19,17 @@
>
> GECKO_191a2_20080815_RELBRANCH
>
> 12345 is a bug
>
> foo 123456 whitespace!
> EOF
- $ hg log -T '{desc|buglink}\n'
+ $ hg log -T '{desc|mozlink}\n'
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1">bug 1</a> - summary line
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=123456">bug 123456</a>
ab4665521e2f
Aug 2008
@@ -45,14 +45,14 @@
$ hg commit -A -l - << EOF
> bug 124562 - fix a thing
>
> Fixes #32 and #462
>
> Source-Repo: https://github.com/mozilla/foo
> EOF
- $ hg log -r . -T '{desc|buglink}\n'
+ $ hg log -r . -T '{desc|mozlink}\n'
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=124562">bug 124562</a> - fix a thing
Fixes <a href="https://github.com/mozilla/foo/issues/32">#32</a> and <a href="https://github.com/mozilla/foo/issues/462">#462</a>
Source-Repo: <a href="https://github.com/mozilla/foo">https://github.com/mozilla/foo</a>
--- a/hgtemplates/gitweb_mozilla/changelogentry.tmpl
+++ b/hgtemplates/gitweb_mozilla/changelogentry.tmpl
@@ -5,12 +5,12 @@
<div class="log_link">
<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">diff</a><br/>
<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">browse</a>
</div>
<cite>{author|obfuscate}</cite> - {date|rfc822date} - rev {rev}<br/>
{if(pushid, 'Push <a href="{url|urlescape}pushloghtml?changeset={node|short}">{pushid}</a> by {pushuser|escape} at {pushdate|isodate}<br />')}
</div>
<div class="log_body">
-{desc|strip|escape|addbreaks|buglink}
+{desc|strip|escape|addbreaks|mozlink}
<br/>
<br/>
</div>
--- a/hgtemplates/gitweb_mozilla/changeset.tmpl
+++ b/hgtemplates/gitweb_mozilla/changeset.tmpl
@@ -24,17 +24,17 @@
<a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a> |
changeset |
<a href="{url|urlescape}raw-rev/{symrev}">raw</a> {archives%archiveentry} |
<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
<br/>
</div>
<div class="title">
-{desc|strip|escape|firstline|buglink|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
+{desc|strip|escape|firstline|mozlink|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
</div>
<div class="title_text">
<table cellspacing="0">
{if(backedoutbynode, '<tr><td colspan="2"><strong>💩💩 backed out by <a style="font-family: monospace" href="{url|urlescape}rev/{backedoutbynode|short}">{backedoutbynode|short}</a> 💩 💩</strong></td></tr>')}
<tr><td>author</td><td>{author|obfuscate}</td></tr>
<tr><td></td><td class="date age">{date|rfc822date}</td></tr>
{branch%changesetbranch}
<tr>
@@ -51,17 +51,17 @@ changeset |
{if(perfherderurl, '<tr><td>perfherder</td><td>[<a href="{perfherderurl}&framework=1" target="_blank">talos</a>] [<a href="{perfherderurl}&framework=2" target="_blank">build metrics</a>] [<a href="{perfherderurl}&framework=6" target="_blank">platform microbench</a>] (compared to previous push)</td></tr>')}
{if(reviewers, '<tr><td>reviewers</td><td>{join(reviewers%reviewerlink, ", ")}</td></tr>')}
{if(bugs, '<tr><td>bugs</td><td>{join(bugs%bughyperlink, ", ")}</td></tr>')}
{if(milestone, '<tr><td>milestone</td><td>{milestone|escape}</td></tr>')}
{if(backsoutnodes, '<tr><td>backs out</td><td>{join(backsoutnodes%backedoutnodelink, ", ")}</td></tr>')}
</table></div>
<div class="page_body">
-{desc|strip|escape|buglink|addbreaks}
+{desc|strip|escape|mozlink|addbreaks}
</div>
<div class="list_head"></div>
<div class="title_text">
<table cellspacing="0">
{files}
</table></div>
<div class="page_body diffblocks">{diff}</div>
--- a/hgtemplates/gitweb_mozilla/filerevision.tmpl
+++ b/hgtemplates/gitweb_mozilla/filerevision.tmpl
@@ -56,16 +56,16 @@ file |
<tr>
<td>permissions</td>
<td style="font-family:monospace">{permissions|permissions}</td>
</tr>
</table>
</div>
<div class="page_path">
-{desc|strip|escape|addbreaks|buglink|nonempty}
+{desc|strip|escape|addbreaks|mozlink|nonempty}
</div>
<div class="page_body">
<pre class="sourcelines stripes">{text%fileline}</pre>
</div>
{footer}
--- a/hgtemplates/gitweb_mozilla/map
+++ b/hgtemplates/gitweb_mozilla/map
@@ -101,17 +101,17 @@ annotateline = '
{if(blockhead,
'<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}">
{rev}
</a>')}
<div class="annotate-info">
<div>
<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}">
{node|short}</a>
- {desc|escape|firstline|buglink}
+ {desc|escape|firstline|mozlink}
</div>
<div><em>{author|obfuscate}</em></div>
<div>parents: {parents%annotateparent}</div>
<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>
<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
</div>
</td>
<td><pre><a class="linenr" href="#{lineid}">{linenumber}</a></pre></td>
@@ -270,37 +270,37 @@ bookmarktag = '<span class="bookmarktag"
shortlogentry = '
<tr class="parity{parity}">
<td class="link">
<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">diff</a><br/>
<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">browse</a>
</td>
<td>{node|short}<br/><i class="age">{date|isodate}</i></td>
<td>
- <strong><cite>{author|person}</cite> - {desc|strip|firstline|escape|buglink}</strong>
+ <strong><cite>{author|person}</cite> - {desc|strip|firstline|escape|mozlink}</strong>
<span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
</td>
</tr>'
pushinfo = '<cite>{user}<br/><span class="date">{date|date}</span></cite>'
mergehidden = '<br/>← {count} merge changesets <a class="expand hideid{id}" href="#">[Collapse]</a>'
-pushlogentry = '<tr class="pushlogentry parity{parity} {hidden} id{id}"><td>{push%pushinfo}</td><td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td><td><strong>{author|person} — {desc|strip|firstline|escape|buglink|addbreaks}</strong> <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span>{mergerollup%mergehidden}</td></tr>\n'
+pushlogentry = '<tr class="pushlogentry parity{parity} {hidden} id{id}"><td>{push%pushinfo}</td><td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td><td><strong>{author|person} — {desc|strip|firstline|escape|mozlink|addbreaks}</strong> <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span>{mergerollup%mergehidden}</td></tr>\n'
filelogentry = '
<tr class="parity{parity}">
<td class="link">
<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">diff</a><br/>
<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">browse</a><br/>
<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
</td>
<td>
{node|short}<br/>created <i>{date|isodate}</i>{rename%filelogrename}
{if(pushdate, '<br/>pushed <i>{pushdate|isodate}</i>', '<br/>pushed <i>unknown</i>')}
</td>
<td><i>{author|person}</i></td>
<td>
- <strong><cite>{author|person}</cite> - {desc|strip|firstline|escape|buglink}</strong>
+ <strong><cite>{author|person}</cite> - {desc|strip|firstline|escape|mozlink}</strong>
<span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
</td>
</tr>'
archiveentry = ' | <a href="{url|urlescape}archive/{symrev}{extension}{ifeq(path,'/','',path|urlescape)}">{type|escape}</a> '
indexentry = '
<tr class="parity{parity}">
<td>
<a class="list" href="{url|urlescape}{sessionvars%urlparameter}">