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

commit-email.pl hook script broken when using -m switch

From: Jason Forkey <jason_at_forkey.net>
Date: 2007-05-02 17:54:38 CEST

Hi,

I attempted to run the commit-email.pl script from within the post-commit hook.
This is the command line I put in post-commit.

commit-email.pl "$REPOS" "$REV" -m scratch -h subvserver jforkey@example.com

When doing an svn commit I get this error from commit-email.pl:
use of either `-h' or `--from' is mandatory when sending email using direct SMTP

After a little debugging it seems that the problem is with the -m argument. It
works fine without specifying any -m expressions. I am running version 1.4.3 of
subversion and haven't modified the commit-email.pl script from its default
behavior (I am using $smtp_server = "127.0.0.1";)

I ran the script in the debugger far enough that I think I see the problem. The
@project_settings_list array contains the initial default project and my
"scratch" project. The hostname gets added to the scratch project but not the
default project, when the default project is checked, the error is produced.
From the help, I think the intent is to delete the default project if a -m is
encountered on the command line. Maybe no one else is using this feature? Here
is the output from the debugger just before the error is triggered:

main::(/usr/local/bin/commit-email.pl:519):
519: if ($subject_prefix =~ /\w/)
520: {
  DB<10> x $project
0 HASH(0x9137364)
   'email_addresses' => ARRAY(0x90a4c84)
        empty array
   'from_address' => ''
   'hostname' => ''
   'log_file' => ''
   'match_re' => (?-xism:.)
      -> qr/(?-xism:.)/
   'match_regex' => '.'
   'reply_to' => ''
   'show_diff' => 1
   'subject_prefix' => ''
  DB<11> x @project_settings_list
0 HASH(0x9137364)
   'email_addresses' => ARRAY(0x90a4c84)
        empty array
   'from_address' => ''
   'hostname' => ''
   'log_file' => ''
   'match_re' => (?-xism:.)
      -> qr/(?-xism:.)/
   'match_regex' => '.'
   'reply_to' => ''
   'show_diff' => 1
   'subject_prefix' => ''
1 HASH(0x949d73c)
   'email_addresses' => ARRAY(0x94abf5c)
      0 'jforkey@example.com'
   'from_address' => ''
   'hostname' => 'svn'
   'log_file' => ''
   'match_re' => (?-xism:scratch)
      -> qr/(?-xism:scratch)/
   'match_regex' => 'scratch'
   'reply_to' => ''
   'show_diff' => 1
   'subject_prefix' => ''
  DB<12>

Thanks
Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 2 17:54:52 2007

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