[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-04-25 18:11:01 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@work.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 projec, 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@work.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: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Apr 25 18:11:23 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.