CVSweb-Bugzilla Integration - Mozilla

This is a discussion on CVSweb-Bugzilla Integration - Mozilla ; Currently working on CVSweb-Bugzilla Integration. Have read links- http://homepages.kcbbs.gen.nz/tonyg/ But prior to that found easier way at link- http://www.einval.com/~steve/software/cvs-bugzilla/ Hence followed it. On cvsweb i am able to integrate with Bugzilla but vice versa is not coming up. Unable to ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: CVSweb-Bugzilla Integration

  1. CVSweb-Bugzilla Integration

    Currently working on CVSweb-Bugzilla Integration.
    Have read links-
    http://homepages.kcbbs.gen.nz/tonyg/

    But prior to that found easier way at link- http://www.einval.com/~steve/software/cvs-bugzilla/

    Hence followed it. On cvsweb i am able to integrate with Bugzilla but
    vice versa is not coming up.

    Unable to generate links on bugzilla page with link to cvsweb. Though
    i made relevant changes in globals.pl. No error is being reported.
    How can i debug it further? or is there any other setting which i need
    to make ?

    It would be great you sparing sometime for me. Any help is highly
    appreciated.


    Thanks in Advance.

  2. Re: CVSweb-Bugzilla Integration

    On Apr 8, 6:09*pm, Thorsten Schöning wrote:
    > Guten Tag kapila.ko...@gmail.com,
    > am Mittwoch, 8. April 2009 um 13:47 schrieben Sie:
    >
    >
    >
    > > But prior to that found easier way at link-
    > >http://www.einval.com/~steve/software/cvs-bugzilla/

    > [...]
    > > Unable to generate links onbugzillapage with link to cvsweb. Though
    > > i made relevant changes in globals.pl. No error is being reported.
    > > How can i debug it further? or is there any other setting which i need
    > > to make ?

    >
    > Those instructions are for quite old versions ofBugzilla, it's likely
    > that the instructions won't work anymore because of changes in
    > generating HTML output. The output is now filtered in the default
    > templates for security reasons, for example.
    >
    > I wouldn't recommend changing globals.pl, what you want is possible by
    > just changing templates. You need to change/override
    > comments.html.tmpl and add something like the following:
    >
    >
    > [%# * * Following links SCMBug-style comments to our WebSVN for sourcecode.
    > * #
    > * # * * First, the originalBugzilla-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 and a not properly functioning link for blame because of no
    > * # * * filename looks bad, 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 usea 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 ofTT. At least I
    > * # * * didn't get it working and found some statements in the web,too.
    > * #
    > * # * *http://template-toolkit.org/docs/man...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, cannotuse references
    > * # * * such as $1 and $2 in the replacement."
    > * #
    > * # * *http://www.stonehenge.com/merlyn/LinuxMag/col61.html
    > * #
    > * # * * Committing via SCMBug one is able to commit to a specific bug in every
    > * # * * repository independent of the name of the current product the bug is filed
    > * # * * at, as long as there is a valid product configured for integrating the
    > * # * * specific repository withBugzilla. We use different SVN-servers with
    > * # * * different repositories for different purposes, therefore weuse different
    > * # * * WebSVN-domains, too.
    > * #
    > * # * * The first replacement of the SCMBug comments creates links with a special
    > * # * * placeholder for the domain part of WebSVN, which will be replaced
    > * # * * afterwards with the needed WebSVN-domain regarding the current name of the
    > * # * * repository found in the commit message by SCMBug. Repository names are
    > * # * * unique, at most, with the different WebSVN-domains.
    > * #%]
    > [%- text = wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    > [%- text = text.replace('([0-9]+|NONE)\s+-->\s+([0-9]+|NONE)\s+([^:]+)(.+)/([^/\n]+)?)', '$1 --> $2 $3:$5/$6 (Blame)')-%]
    > [%- text = text.replace('/ \(Blame\)', '/') -%]
    > [%# * * Extract current repository name used in the commit and searchfor it in
    > * # * * repository name whitelist to determine the WebSVN-domain touse.
    > * #%]
    > [% IF (currentReposName = text.match('')) %]
    > * * * * [% IF currentReposName.0.search('(?i)(?ocBeam3|Briefkaesten)') %]
    > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://binaries.potsdam.am-soft.de') -%]
    > * * * * [% ELSE %]
    > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://quellen.potsdam.am-soft.de') -%]
    > * * * * [% END %]
    > [% END %]
    > [%# Names of repositories may change, but still remain the same in the database
    > * # for comments because they are just provided as text by SCMBug. Thiscan be
    > * # * * overrun here by maintaining a rename list.
    > * #%]
    > [%- text = text.replace('(/|>)DocBeam-Client(/|<)', '$1DocBeam$2') -%]
    > [%- text -%]
    >
    >
    > Mit freundlichen Grüßen,
    >
    > Thorsten Schöning
    >
    > --
    > Thorsten Schöning
    > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
    >
    > Telefon: Potsdam: 0331-743881-0
    > E-Mail: *tschoen...@am-soft.de
    > Web: * *
    http://www.am-soft.de
    >
    > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


    Thanks Thorsten for replying.
    I have tried to read the file comments.html.tmpl which is in path -> /
    usr/local/apache2/htdocs/bugzilla/data/template/template/en/default/
    bug
    I am using Bugzilla version 3.0.
    You suggest that i should append line
    in my
    comments.html.tmpl

    If i try to find out the link in file its like-

    cat comments.html.tmpl | grep comment_text

    $output .= "\n\n \n\n";
    $output .= ' id="comment_text_' . $stash->get('count') .
    '"';


    According to u , i should append this file rt?

  3. Re: CVSweb-Bugzilla Integration

    On Apr 9, 8:34*am, kapila.ko...@gmail.com wrote:
    > On Apr 8, 6:09*pm, Thorsten Schöning wrote:
    >
    >
    >
    > > Guten Tag kapila.ko...@gmail.com,
    > > am Mittwoch, 8. April 2009 um 13:47 schrieben Sie:

    >
    > > > But prior to that found easier way at link-
    > > >http://www.einval.com/~steve/software/cvs-bugzilla/

    > > [...]
    > > > Unable to generate links onbugzillapage with link to cvsweb. Though
    > > > i made relevant changes in globals.pl. No error is being reported.
    > > > How can i debug it further? or is there any other setting which i need
    > > > to make ?

    >
    > > Those instructions are for quite old versions ofBugzilla, it's likely
    > > that the instructions won't work anymore because of changes in
    > > generating HTML output. The output is now filtered in the default
    > > templates for security reasons, for example.

    >
    > > I wouldn't recommend changing globals.pl, what you want is possible by
    > > just changing templates. You need to change/override
    > > comments.html.tmpl and add something like the following:

    >
    > >
    > > [%# * * Following links SCMBug-style comments to our WebSVN for sourcecode.
    > > * #
    > > * # * * First, the originalBugzilla-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, pathand 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 and a not properly functioning link for blame because of no
    > > * # * * filename looks bad, after the first replacement I replaceevery empty link
    > > * # * * for the filename and the corresponding "Blame" with nothing.
    > > * #
    > > * # * * Replacement needs the ability to capture some informationfrom 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/man...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
    > > * #
    > > * # * * Committing via SCMBug one is able to commit to a specificbug in every
    > > * # * * repository independent of the name of the current productthe bug is filed
    > > * # * * at, as long as there is a valid product configured for integrating the
    > > * # * * specific repository withBugzilla. We use different SVN-servers with
    > > * # * * different repositories for different purposes, therefore we use different
    > > * # * * WebSVN-domains, too.
    > > * #
    > > * # * * The first replacement of the SCMBug comments creates links with a special
    > > * # * * placeholder for the domain part of WebSVN, which will be replaced
    > > * # * * afterwards with the needed WebSVN-domain regarding the current name of the
    > > * # * * repository found in the commit message by SCMBug. Repository names are
    > > * # * * unique, at most, with the different WebSVN-domains.
    > > * #%]
    > > [%- text = wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    > > [%- text = text.replace('([0-9]+|NONE)\s+-->\s+([0-9]+|NONE)\s+([^:]+)(.+)/([^/\n]+)?)', '$1 --> $2 $3:$5/$6 (Blame)') -%]
    > > [%- text = text.replace('/ \(Blame\)', '/') -%]
    > > [%# * * Extract current repository name used in the commit and search for it in
    > > * # * * repository name whitelist to determine the WebSVN-domain to use.
    > > * #%]
    > > [% IF (currentReposName = text.match('')) %]
    > > * * * * [% IF currentReposName.0.search('(?i)(?ocBeam3|Briefkaesten)') %]
    > > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://binaries.potsdam.am-soft.de') -%]
    > > * * * * [% ELSE %]
    > > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://quellen.potsdam.am-soft.de') -%]
    > > * * * * [% END %]
    > > [% END %]
    > > [%# Names of repositories may change, but still remain the same in the database
    > > * # for comments because they are just provided as text by SCMBug. This can be
    > > * # * * overrun here by maintaining a rename list.
    > > * #%]
    > > [%- text = text.replace('(/|>)DocBeam-Client(/|<)', '$1DocBeam$2') -%]
    > > [%- text -%]
    > >

    >
    > > Mit freundlichen Grüßen,

    >
    > > Thorsten Schöning

    >
    > > --
    > > Thorsten Schöning
    > > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig

    >
    > > Telefon: Potsdam: 0331-743881-0
    > > E-Mail: *tschoen...@am-soft.de
    > > Web: * *
    http://www.am-soft.de
    >
    > > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow

    >
    > Thanks Thorsten for replying.
    > I have tried to read the file comments.html.tmpl *which is in path -> /
    > usr/local/apache2/htdocs/bugzilla/data/template/template/en/default/
    > bug
    > I am usingBugzillaversion 3.0.
    > You suggest that i should append line
    > in my
    > comments.html.tmpl
    >
    > If i try to find out the link in file its like-
    >
    > cat comments.html.tmpl *| grep comment_text
    >
    > * * $output .= *"\n\n *\n\n";
    > * * * * $output .= *' id="comment_text_' *. $stash->get('count') *.
    > '"';
    >
    > According to u , i should append this file rt?


    Hi,
    Please ignore my previous message.
    I have found the file which you suggest to edit its /usr/local/apache2/
    htdocs/bugzilla/template/en/default/bug/comments.html.tmpl

    Currently in this file i hv text as -

    [%- wrapped_comment FILTER quoteUrls(bug.bug_id) -%]


    which i tried to replace it with -



    [%- text = wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    [%- text = text.replace('([0-9]+|NONE)\s+-->\s+([0-9]+|NONE)\s+([^:]
    +)(.+)/([^/\n]+)?)', '$1 --> $2 $3 a>:$5/ href="http://svn/cvsweb/cvsweb.cgi/$3/$4">$6 (Blame)') -%]
    [%- text = text.replace('/ a> \(Blame\)', '/') -%]
    [%# Extract current repository name used in the commit and search
    for it in
    # repository name whitelist to determine the WebSVN-domain to
    use.
    #%]
    [% IF (currentReposName = text.match('http://svn/cvsweb/
    cvsweb.cgi/([^/]+)/.+\?rev=(?:[0-9]+|NONE)">')) %]
    [% IF currentReposName.0.search('(?i)(?ocBeam3|
    Briefkaesten)') %]
    [%- text = text.replace('\http://svn/cvsweb/
    cvsweb.cgi', 'http://svn/cvsweb/cvsweb.cgi') -%]
    [% END %]
    [% END %]
    [%# Names of repositories may change, but still remain the same in the
    database
    # for comments because they are just provided as text by SCMBug.
    This can be
    # overrun here by maintaining a rename list.
    #%]
    [%- text = text.replace('(/|>)DocBeam-Client(/|<)', '$1DocBeam$2') -%]
    [%- text -%]


    Any change i try to do in this file get error-(even i giving a space)
    It doesn't change any permissions in the file.

    file error - cache failed to write comments.html.tmpl: Error in
    tempfile() using data/template/template/en/default/bug/XXXXXXXXXX:
    Parent directory (data/template/template/en/default/bug/) is not
    writable at /usr/lib/perl5/site_perl/5.8.8/i686-linux/Template/
    Document.pm line 295

    Only fix is get org copy from backup.

    Any idea where i am going wrong?

  4. Re: CVSweb-Bugzilla Integration

    On Apr 9, 12:31*pm, Thorsten Schöning wrote:
    > Guten Tagkapila.ko...@gmail.com,
    > am Donnerstag, 9. April 2009 um 07:17 schrieben Sie:
    >
    > > Any change i try to do in this file get error-(even i giving a space)
    > > It doesn't change any permissions in the file.
    > > file error - cache failed to write comments.html.tmpl: Error in
    > > tempfile() using data/template/template/en/default/bug/XXXXXXXXXX:
    > > Parent directory (data/template/template/en/default/bug/) is not
    > > writable at /usr/lib/perl5/site_perl/5.8.8/i686-linux/Template/
    > > Document.pm line 295
    > > Only fix is get org copy from backup.
    > > Any idea where i am going wrong?

    >
    > You should read the instructions on customizing Bugzillas templates:
    >
    > http://www.bugzilla.org/docs/3.0/htm...omization.html
    >
    > I think your problem is not running checksetup.pl after changing the
    > templates. Tchecksetup.pl will precompile and save the templates where
    > you get your permission error. In this case checksetup.pl would
    > normally run as root. If you don't do that Template Toolkit maybe
    > recognizes changes in the template file, wants to compile it itself,
    > but this time running in your webservers context which normally
    > doesn't need write permissions in data/template, I think.
    >
    > Also, what I copied was a functional integration of SCMBug and WebSVN,
    > it's not likely that the regexes will work for. It's intended to
    > filter comments like the following and linkify them. The important
    > thing is to make your changes after FILTER quoteUrls and use
    > text.replace as you need it.
    >
    > Branch: * * * *trunk
    > Affected files:
    > ---------------
    > NONE --> 207 Testprodukt:trunk/Neu Textdokument.txt
    > 160 --> NONE Testprodukt:trunk/phptest.php
    >
    > Mit freundlichen Grüßen,
    >
    > Thorsten Schöning
    >
    > --
    > Thorsten Schöning
    > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
    >
    > Telefon: Potsdam: 0331-743881-0
    > E-Mail: *tschoen...@am-soft.de
    > Web: * *http://www.am-soft.de
    >
    > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


    Thanks Once again Thorsten. You made many things clear to me.
    Now i got it. Why i was getting error when i use to change template
    file -"comments.html.tmpl" since its a precomplied file.
    Wondering if i change only a single file i.e comments.html.tmpl for
    instance, then can it be possible that checksetup.pl only compile that
    file instead of doing other stuff too?

    About regex, i can reach to that point once i can get my single file
    compiled..
    so can ./checksetup.pl template/comments.html.tmpl work?

  5. Re: CVSweb-Bugzilla Integration

    On Apr 9, 4:12*pm, Thorsten Schöning wrote:
    > Guten Tagkapila.ko...@gmail.com,
    > am Donnerstag, 9. April 2009 um 12:30 schrieben Sie:
    >
    > > so can ./checksetup.pl template/comments.html.tmpl *work?

    >
    > Please do as the docs say, change your template, run checksetup.pl and
    > see what happens. You shouldn't get any permission error. Running
    > checksetup.pl with just one file won't work.
    >
    > Mit freundlichen Grüßen,
    >
    > Thorsten Schöning
    >
    > --
    > Thorsten Schöning
    > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
    >
    > Telefon: Potsdam: 0331-743881-0
    > E-Mail: *tschoen...@am-soft.de
    > Web: * *http://www.am-soft.de
    >
    > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


    Hi Thorsten,
    I have finally succeeded in completing it. Please accept my
    heartiest thanks for all your help.
    Adding my updated code here.. may be later someone can get benefited
    from it-


    [%# Code added by Kapila Narang(CM) to integrate CVSweb with
    Bugzilla #%]
    [%- text= wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    [%- text= text.replace('FILES CHECKED IN:[\s]+(.*?)\s+(\d+\.\d+(\.*
    \d*)*)\s+ (\d+\.\d+(\.*\d*)*|NONE)*','FILES CHECKED IN: href="http://cvsweb/cvsweb.cgi/$1">$1 $2 $4 -->Diff') -%]
    [%- text = text.replace('/ \(Blame\)', '/') -%]
    [%- text -%]



    thanks once again

    kapila

  6. Re: CVSweb-Bugzilla Integration- How to edit template(comments.html.tmpl)

    On Apr 13, 3:22*pm, kapila.ko...@gmail.com wrote:
    > On Apr 9, 4:12*pm, Thorsten Schöning wrote:
    >
    >
    >
    > > Guten Tagkapila.ko...@gmail.com,
    > > am Donnerstag, 9. April 2009 um 12:30 schrieben Sie:

    >
    > > > so can ./checksetup.pl template/comments.html.tmpl *work?

    >
    > > Please do as the docs say, change your template, run checksetup.pl and
    > > see what happens. You shouldn't get any permission error. Running
    > > checksetup.pl with just one file won't work.

    >
    > > Mit freundlichen Grüßen,

    >
    > > Thorsten Schöning

    >
    > > --
    > > Thorsten Schöning
    > > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig

    >
    > > Telefon: Potsdam: 0331-743881-0
    > > E-Mail: *tschoen...@am-soft.de
    > > Web: * *http://www.am-soft.de

    >
    > > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow

    >
    > Hi Thorsten,
    > * * I have finally succeeded in completing it. Please accept my
    > heartiest thanks for all your help.
    > Adding my updated code here.. may be later someone can get benefited
    > from it-
    >
    >
    > * [%# Code added byKapilaNarang(CM) to integrate CVSweb with
    > Bugzilla #%]
    > * [%- text= wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    > * [%- text= text.replace('FILES CHECKED IN:[\s]+(.*?)\s+(\d+\.\d+(\.*
    > \d*)*)\s+ (\d+\.\d+(\.*\d*)*|NONE)*','FILES CHECKED IN: > href="http://cvsweb/cvsweb.cgi/$1">$1 *$2 $4 -->Diff') -%]
    > * * *[%- text = text.replace('/ \(Blame\)', '/') -%]
    > * * *[%- text -%]
    >
    >
    > thanks once again
    >
    > kapila


    Hi,
    Actually the solution i derived was only for certain pattern of
    file. But it doesn't work if i have different pattern.
    I mean- It works only in case pattern is
    FILES CHECKED IN:
    TESTKK/testing-file.txt 1.6 1.7

    But there are scenarios where we can have more than 1 files check-in
    i.e On bugzilla we can have comments as
    FILES CHECKED IN:
    orion/WEB-INF//Video.java NONE 1.1.2.1
    orion/WEB-INF/src//Review.java NONE 1.1.2.1
    orion/WEB-INF/src/com/mmt/hotels/seo/beans/Area.java NONE
    1.1.2.1
    orion/WEB-INF/src/com/mmt/hotels/seo/beans/CategoryHotel.java
    NONE 1.1.2.1
    orion/WEB-INF/src/com/mmt/hotels/seo/beans/HotelDistance.java
    NONE 1.1.2.1
    orion/WEB-INF/src/com/mmt/hotels/seo/beans/Amenity.java
    NONE 1.1.2.1

    I can have as many check-ins. Need to make all file linked to cvsweb/
    filename, all revision linked to it respective versions.
    For this is need to edit comments.html.tmpl.

    Got the pattern( '([\w./]+)\s+([\d.]+|NONE)\s+([\d.]+|NONE)' working
    for such scenarios, but how to insert this in template file. I worked
    on the syntax of template file.
    i.e if i have to define a scalar variable [% pattern %]= '([\w./]+)\s+
    ([\d.]+|NONE)\s+([\d.]+|NONE)'
    then it doesn't work when i call with $pattern. Another imp thing how
    can i call a array
    i.e desired thing=
    [% pattern %] = '([\w./]+)\s+([\d.]+|NONE)\s+([\d.]+|NONE)';
    [% i %] = ""
    [% IF ( ( @matches = $var = text.match{$pattern}g ) >0 ) {
    [% text.replace ($matches[$i],' ' %]


    Can anyone suggest me what syntax i sm going wrong?

  7. Re: CVSweb-Bugzilla Integration- How to edit template(comments.html.tmpl)

    On Apr 15, 12:02*pm, Thorsten Schöning wrote:
    > Guten Tag kapila.ko...@gmail.com,
    > am Mittwoch, 15. April 2009 um 06:33 schrieben Sie:
    >
    >
    >
    > > * *Actually the solution i derived was only for certain pattern of
    > > file. But it doesn't work if i have different pattern.
    > > I mean- It works only in case *pattern is
    > > FILES CHECKED IN:
    > > * TESTKK/testing-file.txt * * * 1.6 * *1.7
    > > But there are scenarios where we can have more than 1 files check-in
    > > i.e On bugzilla we can have comments as
    > > FILES CHECKED IN:
    > > * orion/WEB-INF//Video.java NONE * *1.1.2.1
    > > * orion/WEB-INF/src//Review.java * * * *NONE * *1.1.2.1
    > > * orion/WEB-INF/src/com/mmt/hotels/seo/beans/Area.java *NONE
    > > 1.1.2.1
    > > * orion/WEB-INF/src/com/mmt/hotels/seo/beans/CategoryHotel.java
    > > NONE * *1.1.2.1
    > > * orion/WEB-INF/src/com/mmt/hotels/seo/beans/HotelDistance.java
    > > NONE * *1.1.2.1
    > > * orion/WEB-INF/src/com/mmt/hotels/seo/beans/Amenity.java
    > > NONE * *1.1.2.1

    >
    > .replace is globally, it should replace all occurences of the
    > specified regex and works like that for me. If it's not the case for I
    > think your regex doesn't match the "NONE"-lines properly.
    >
    > http://template-toolkit.org/docs/man...method_replace
    >
    > > [% pattern %] = '([\w./]+)\s+([\d.]+|NONE)\s+([\d.]+|NONE)';

    >
    > I think this yould be something like the following:
    >
    > [%- text = wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
    > [%- text = text.replace('(/|>)DocBeam-Client(/|<)', '$1DocBeam$2') -%]
    > [%- text -%]
    >
    > First line saves some text in variable "text" which doesn't need to be
    > declared in any way. Second one replaces text regarding the specified
    > regex and saves it again, the third lines prints the saved text.
    >
    > > [% i %] = ""
    > > [% IF *( ( @matches = $var = text.match{$pattern}g ) >0 ) {
    > > * * [% text.replace ($matches[$i],' ' %]

    >
    > Another example:
    >
    > [% IF (currentReposName = text.match('')) %]
    > * * * * [% IF currentReposName.0.search('(?i)(?ocBeam3|Briefkaesten)') %]
    > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://binaries.potsdam.am-soft.de') -%]
    > * * * * [% ELSE %]
    > * * * * * * * * [%- text = text.replace('\$currentWebSVNDomain', 'http://quellen.potsdam.am-soft.de') -%]
    > * * * * [% END %]
    > [% END %]
    >
    > Template Toolkit has some good docs:
    >
    >
    http://template-toolkit.org/docs/manual/index.html
    >
    > Mit freundlichen Grüßen,
    >
    > Thorsten Schöning
    >
    > --
    > Thorsten Schöning
    > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
    >
    > Telefon: Potsdam: 0331-743881-0
    > E-Mail: *tschoen...@am-soft.de
    > Web: * *http://www.am-soft.de
    >
    > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
    > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


    Thanks Thorsten for your reply.
    regex written is matching the pattern as required.
    I have tried to edit template by code:-

    [% currentRep= 'http://svn/cvsweb/cvsweb.cgi' %]

    [% SET filename = 'value' IF text.match('/([\w./]+)[\s|\n]+/g') %]
    [% text= text.replace('$filename','
    $filename
    ') %]
    [% SET matches = 'value' IF text.match('/[\w./]+[\s|\n]+([\d.]+|
    NONE)[\s|\n]+([\d.]+|NONE)/g') %]
    [% FOREACH match IN matches %]
    [% text= text.replace('$match','$match') %]
    [% END %]

    [%- text -%]


    [% END %]

    but seems i am missing something. I wish to use index in the LIST
    (matches) but unable to get the usage properly.
    Any suggestions?

+ Reply to Thread