[[PageOutline(2-5,Contents,pullout)]] = WikiFormatting for revision links on Trac with multiple repositories = '''This was added at trac:ticket:9570 to Trac 0.12.1. This plugin isn't needed anymore.''' == Description == When multiple repositories are configured, the `r123` syntax doesn't enable you to specify the repository and the `[changeset:123/repo]` or `[123/repo]` syntax must be used instead. As I do find the `r123` syntax more readable, I wrote this small plugin that lets you use 'r123repo' (simply add the repository name right after the changeset number), which is displayed as `repo/r123` with a link to the changeset. Parsing `repo/r123` syntax isn't possible (AFAIK) as the built-in parser parses the `r123` part, so the syntax is `r123repo` but it displays as `repo/r123`. == Bugs/Feature Requests == I'm usually at #trac as shsek or shesek. My email is nadav at humaninternals /nospam/ com. You can also leave bug reports as a comment [http://www.codenition.com/trac-r123-wikisyntax-for-multiple-repositories here], as I probably won't follow bug reports on the Trac here. Existing bugs and feature requests for RepoRevisionSyntaxPlugin are [report:9?COMPONENT=RepoRevisionSyntaxPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=RepoRevisionSyntaxPlugin&owner=shesek new ticket]. == Installation == Simply drop the source code as a .py file directly in your plugins directory == Source == {{{ #!python from trac.core import * from trac.wiki import IWikiSyntaxProvider from genshi.builder import tag class RepoRevisionSyntax(Component): implements(IWikiSyntaxProvider) def get_wiki_syntax(self): yield ( r'[r#](?P\d+)(?P[a-zA-Z0-9_\/]+)', self._format_regex_link) def get_link_resolvers(self): pass def _format_regex_link(self, formatter, ns, match): return tag.a('%s/r%s' % (match.group('repo'), match.group('rev_id')), href=formatter.href.changeset('%s/%s'%(match.group('rev_id'), match.group('repo')))) }}} == Example == `Fixed by r78trac` (as a ticket comment, for example) would get displayed as `Fixed by trac/r78`, `trac/r78` being a link to the changeset. == Recent Changes == [[ChangeLog(reporevisionsyntaxplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:shesek] / Nadav [[BR]] '''Maintainer:''' [wiki:shesek] [[BR]] '''Contributors:''' Jonathan