[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

commit-email.pl: problems with regex

From: Tremal Naik <tremalnaik_at_gmail.com>
Date: 2007-08-02 15:44:28 CEST

Hi to the fellowship of Subversion,
I'm facing a problem with the commit-email.pl script. I can
successfully run it if invoked by the post-hook script like this:

commit-email.pl "$REPOS" "$REV" --from "no_replies@fuffa.com" --diff n
commit-watchers@fuffa.com

but when I try to use the '-m' switch to filter the project paths like this:

commit-email.pl "$REPOS" "$REV" -m ".*\/deploy\/.*" --from
"no_replies@fuffa.com" --diff n deploy-watchers@fuffa.com

It does't work. I think I'm invoking it correctly according to the synopsis:

"usage (commit mode):
  ./commit-email.pl REPOS REVNUM [[-m regex] [options] [email_addr ...]] ..."

Invoking the script from command line I get the error:

"./commit-email.pl: use of either `-h' or `--from' is mandatory when
sending email using direct SMTP."

and debugging the script with the perl debugger I see that the problem may be:

        else
          {
            if ($arg eq '-m')
              {
                $current_project = &new_project;
                $current_project->{match_regex} = $value;
                push(@project_settings_list, $current_project);
              }

In fact, when the '-m' switch is invoked, the $current_project
variable is initialised again and pushed into the
@project_settings_list variable as element at index 1. When the
following block of code code is executed:

foreach my $project (@project_settings_list)
  {
    my $match_re = $project->{match_re};

the project at index 0 in the @project_settings_list is
un-initialized, hence the program exits with the above error.

Any hints?

I hope it's me doing something inappropriate

-- 
TREMALNAIK
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 2 15:43:05 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.