r102718 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102717‎ | r102718 | r102719 >
Date:23:35, 10 November 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Add really basic RT linker

Granted, it's not open to everyone, but having RT linking for those who can is rather useful

Should probably standardise the format a little, and work out if we need a more complex regex
Modified paths:
  • /trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm (modified) (history)

Diff [purge]

Index: trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm
@@ -45,6 +45,10 @@
4646 match => qr{r(\d+)},
4747 replace => \&_createCodeReviewLink
4848 };
 49+ my $replacerRT = {
 50+ match => qr{rt\ ?\#?(\d+)},
 51+ replace => \&_createRTLink
 52+ };
4953 #~\br(\d+)\b
5054 # "<a href=\"https://www.mediawiki.org" .
5155 # "/wiki/Special:Code/MediaWiki/$1\" " .
@@ -52,6 +56,7 @@
5357
5458 push( @$regexes, $replacerWP );
5559 push( @$regexes, $replacerCR );
 60+ push( @$regexes, $replacerRT );
5661 }
5762
5863 sub _createWikipediaLink {
@@ -65,5 +70,10 @@
6671 my $rev_link = "<a href=\"https://www.mediawiki.org/wiki/Special:Code/MediaWiki/$1\" title=\"revision $1 in SVN\">r$1</a>";
6772 return $rev_link;
6873 };
 74+
 75+sub _createRTLink {
 76+ my $rev_link = "<a href=\"https://rt.wikimedia.org/Ticket/Display.html?id=$1\" title=\"RT #$1\">RT #$1</a>";
 77+ return $rev_link;
 78+};
6979
7080 __PACKAGE__->NAME;

Comments

#Comment by 😂 (talk | contribs)   04:42, 21 March 2012

While you're here, we should go ahead and do one for gerrit.

Status & tagging log