Hi.

I took your advice and switched to commit-email-codestriker.pl. However, I've noticed that there seems to be a bug in it with regard to BUG ids (ironically enough).

The file contains the following lines

    # Check for any matching Bug id text.
    my @bugs = ();
    $bug_ids =~ s/.*[Bb][Uu][Gg]:?(\d+)\b.*/$1 /g;
    while ($bug_ids =~ /\b[Bb][Uu][Gg]:?\s*(\d+)\b/g)
    {
        push @bugs, $1;
    }

The line beginning "$bug_ids=~" seems to break the parsing of the the bug identifiers. Removing it fixes the problem.

My exposure to the usage of regular expressions is pretty limited (Mastering Regular Expressions by Jeffrey Friedl is now on order).

I'm using TortoiseSVN and I would like to parse the commit message so that it could pick out multiple bug identifiers in the format used by Tortoise when the "bugtraq:number" property is set (i.e. expressions containing comma separated ids). So I would want ot parse a string like "this fixes bug:2,34,55". Ultimately, I guess it would be cool if it could parse a string like "this fixes BUGs 3,44,   55 and bug:99, not forgetting bug11 and 14".

Regards

Eugene




2009/3/1 David Sitsky <david.sitsky@gmail.com>
Well I think I just embarrassed myself... pop/push actually do work on
the end of the list, not the start!  My bad.

I must admit, I actually haven't used subversion-post-commit.pl in a
while.  I have been using commit-email-codestriker.pl instead, which
is based off Subversion's post-commit script.  This is why this script
is currently broken.  I actually prefer the other script, as it sends
an email out with the diff text, and a link to the new topic.

So yes - those "pop" calls should really be "shift".  And you are
right, we need  'topic_state
> => "Open"' now in the CodestrikerClient call, as that was added recently.

Thanks for the report, I'll fix up this old script.

Cheers,
David

On Mon, Mar 2, 2009 at 8:26 AM, Eugene Gill <minty@keergill.co.uk> wrote:
> Hi.
>
> Far be it for me, to contradict you on this, I'm no perl expert. but I can
> only tell you my experience of trying to set this up earlier today.
>
> If I call the script directly, like below, I get the following:
>
> sunny-jim bin # ./subversion-post-commit.pl
> /var/svn/svn.keergill.com/jetbyte 17
>
> ...
> <title>Codestriker error</title>
> ...
> <body bgcolor="white">
> <p /><FONT COLOR='red'>Input parameter email has invalid value:
> ./subversion-post-commit.pl: `/usr/bin/svnlook info 17 -r
> /var/svn/svn.keergill.com/jetbyte&#39; failed with this
> output:@keergill.com</FONT><p />
> </body>
> ...
>
> Clearly from the error message its trying to apply the repository value to
> the revision number parameter because its pulling off the parameters in the
> reverse order to that expected by the code.
>
> If I then reverse the parameters, I get the following
>
> sunny-jim bin # ./subversion-post-commit.pl 17
> /var/svn/svn.keergill.com/jetbyte
>
> ...
> <title>Codestriker error</title>
> ...
> <body bgcolor="white">
> <p /><FONT COLOR='red'>Topic state  unrecognised</FONT><p />
> </body>
> ...
>
> So now I find that the call to CodestrikerClient::create_topic is failing
> because the topic_state parameter is not initialised. If I add 'topic_state
> => "Open"' to the parameter list on the call to create_topic everything
> works hunky dory (at least on first inspection, I haven't tried the script
> in the subversion post-commit hook again yet.
>
> Regards
>
> Eugene Gill
>
>
>
> 2009/3/1 David Sitsky <david.sitsky@gmail.com>
>>
>> Hi Eugene,
>>
>> I use this scripts at my work, so they work fine.
>>
>> The push and pop operators in perl work more in the metaphor of a
>> stack, not a list. So pop removes the first element from the list, not
>> the last.
>>
>> Cheers,
>> David
>>
>> On Mon, Mar 2, 2009 at 2:10 AM, Eugene Gill <minty@keergill.co.uk> wrote:
>> > Hi.
>> >
>> > I'm just in the process of trying to set up Codestriker to automatically
>> > generate reviews for SVN commits and am looking at this script. Has it
>> > actually been tested?
>> >
>> > The following lines pop the command line arguments off from the end of
>> > the
>> > list and therefore in the opposite order to that suggested in the
>> > comment
>> > and the documentation.
>> >
>> > # First argument is the repository followed by the revision number.
>> > my $repository = pop @ARGV;
>> > my $revision = pop @ARGV;
>> >
>> > Apologies if I'm being somehow stupid, but it surprises me that this has
>> > gone unspotted until now.
>> >
>> > Eugene
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Open Source Business Conference (OSBC), March 24-25, 2009, San
>> > Francisco, CA
>> > -OSBC tackles the biggest issue in open source: Open Sourcing the
>> > Enterprise
>> > -Strategies to boost innovation and cut costs with open source
>> > participation
>> > -Receive a $600 discount off the registration fee with the source code:
>> > SFAD
>> > http://p.sf.net/sfu/XcvMzF8H
>> > _______________________________________________
>> > Codestriker-user mailing list
>> > Codestriker-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/codestriker-user
>> >
>> >
>
>