Thanks,

I'll have a closer look at it.

Best regards,
Marcel Loose.

On Wed, 2009-12-16 at 17:33 +0100, Thorsten Schöning wrote:
> Guten Tag Marcel Loose,
> am Mittwoch, 16. Dezember 2009 um 17:03 schrieben Sie:
> 
> > I'm considering to upgrade our systems to the latest Bugzilla, Scmbug,
> > Subversion, etc. I'm afraid I'll have to figure out (again) how to do
> > autolinkification, so any pointers would be welcome.
> 
> Just full quoting my mail from 01.02.2009 15:36:
> 
> Hallo,
> 
> if anyone is interested in, at least in my mind, an easy way to get
> linkification for SCMBug comments in Bugzilla, here's a suggestion
> with just changing one template.
> 
> Besides changing the Bugzilla function quoteUrls in Bugzilla::Template
> like suggested, I got the linkification working by just changing the
> template for presenting comments. I created a copy of
> comments.html.tmpl in
> Bugzilla/template/de/custom/bug/comments.html.tmpl and changed the
> last lines for printing the pre-tag to the following:
> 
> <pre[% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]>
> [%#     Following links SCMBug-style comments to our WebSVN for sourcecode.
>   #
>   #     First, the original Bugzilla-style comment is saved and a regexp used
>   #     to replace the produced text by SCMBug with the appropiate links to
>   #     WebSVN. Version numbers, the -->-diff, product name, path and filename
>   #     are replaced with links. If no filename is present, e.g. because of
>   #     adding a directory, an empty link for filename is generated, which is
>   #     not displayed to the user, though. Because I want to be able to blame
>   #     the file, after the first replacement I replace every empty link for
>   #     the filename and the corresponding "Blame" with nothing.
>   #
>   #     Replacement needs the ability to capture some information from the 
> source
>   #     string, like versin numbers etc., and therefore we must use a function
>   #     not only accepts a regexp for the source string to replace, but also 
> for
>   #     the replacement string to use captured parts of the source string. 
> This
>   #     seems only to be the case for the replace-method of the VMethod of 
> Template
>   #     Toolkit, NOT for the replace-method of the String-Plugin of TT. At 
> least I
>   #     didn't get it working and found some statements in the web, too.
>   #
>   #     http://template-toolkit.org/docs/manual/VMethods.html#method_replace
>   #
>   #     "The repeat filter makes copies of the source material. remove takes 
> a Perl
>   #     regular expression, deleting the matching occurrences. replace takes a
>   #     regular expression and replacement string, but alas, cannot use 
> references
>   #     such as $1 and $2 in the replacement."
>   #
>   #     http://www.stonehenge.com/merlyn/LinuxMag/col61.html
>   #%]
> [%- text = wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
> [%- text = 
> text.replace('([0-9]+|NONE)\s+--&gt;\s+([0-9]+|NONE)\s+([^:]+):((.+)/([^/\n]+)?)',
>  '<a href="http://quellen.potsdam.am-soft.de/wsvn/$3/$4?rev=$1";>$1</a> <a
> href="http://quellen.potsdam.am-soft.de/wsvn/$3/$4?op=diff&rev=$2";>--&gt;</a> 
> <a href="http://quellen.potsdam.am-soft.de/wsvn/$3/$4?rev=$2";>$2</a> <a
> href="http://quellen.potsdam.am-soft.de/wsvn/$3/";>$3</a>:<a 
> href="http://quellen.potsdam.am-soft.de/wsvn/$3/$5/#path_$5";>$5</a>/<a 
> href="http://quellen.potsdam.am-soft.de/wsvn/$3/$4";>$6</a> (<a
> href="http://quellen.potsdam.am-soft.de/wsvn/$3/$4?op=blame";>Blame</a>)') -%]
> [%- text.replace('/<a href="http://quellen.potsdam.am-soft.de/wsvn/.+";></a> 
> \(<a href="http://quellen.potsdam.am-soft.de/wsvn/.+";>Blame</a>\)', '/') -%]
> </pre>
> 
> > BTW: What is the latest version of Bugzilla supported by Scmbug? 
> 
> I think it was 3.2.
> 
> Mit freundlichen Grüßen,
> 
> Thorsten Schöning
> 

_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to