As I am in a rush to get this Email function working.Here is the way I get it 
working, now bugzilla cansend me an Email when scmbug happens a comment.
1: I modify /usr/sbin/scmbug_daemon.pl as below.
 
# SCM tool with bugtracking
use strict;use lib "/usr/share/scmbug/lib";use Scmbug::Daemon::Daemon;
# Begin Added For Bugzilla to send Email
use lib qw( /var/www/html/bugzilla );require 
"/var/www/html/bugzilla/globals.pl";use Bugzilla::BugMail;use Bugzilla::User;
# End
main ( @ARGV );exit 0;
## Main workhorse#sub main {    my ( @arguments ) = ( @_ );    my $daemon = 
Scmbug::Daemon::Daemon->new();
    $daemon->start_daemon( @arguments );}
 
2: And I modify /usr/share/scmbug/lib/Scmbug/Daemon/Bugzilla.pm
 
and added the following line to it:
Bugzilla::BugMail::Send($bugid, {'changer' => $userid });
as I am  using Bugzilla 2.20I put the line to the correct version for 2.20.
    if ( $self->is_version_up_to_2_20() ) {        # Bugzilla 2.20 does not 
have AppendComment in globals.pl It        # was moved to Bugzilla::Bug. The 
original AppendComment takes        # the user ID instead of the user name, so 
we need to convert        # it here        my $userid = 
Bugzilla::User::login_to_id( $username );
        if ( $userid > 0 ) {            bugzilla_2_20_fixed_AppendComment( 
$bugid, $userid, $comment );
            Bugzilla::BugMail::Send($bugid, {'changer' => $userid });
            return 0;        } else {
and it is done.
 
 
 



From: [email protected]: [email protected]: Wed, 17 Dec 2008 
04:30:45 +0000CC: [email protected]: Re: [scmbug-users] 
[email protected]

Hi Kristis, Looks like "globals.pl" is not loaded in Bugzilla.pmeven the scmbug 
has some codes to load it. I tried to use a bugzilla function to send the 
Emailafter adding a comment to a bug, I got this error: GetVersionTable 
function is defined in globals.pl > grep GetVersionTable globals.plsub 
GetVersionTable { 2008/12/16 23:23:01 Scmbug WARN> 
Daemon.pm:567:Scmbug::Daemon::Daemon::spawn_child - 127.0.0.1:59496 Processing 
connection from neptune2008/12/16 23:23:01 Scmbug WARN> 
Process.pm:886:Scmbug::Daemon::Process::process_activity_verify - 
127.0.0.1:59496 Processing an 'activity_verify' for bug id '2302' from SCM user 
'rveve'2008/12/16 23:23:01 Scmbug WARN> 
Daemon.pm:581:Scmbug::Daemon::Daemon::spawn_child - 127.0.0.1:59496 Connection 
from neptune processed2008/12/16 23:23:02 Scmbug WARN> 
Daemon.pm:567:Scmbug::Daemon::Daemon::spawn_child - 127.0.0.1:59497 Processing 
connection from neptune2008/12/16 23:23:02 Scmbug WARN> 
Process.pm:867:Scmbug::Daemon::Process::process_activity_commit - 
127.0.0.1:59497 Processing an 'activity_commit' for bug id '2302' from SCM user 
'rveve'2008/12/16 23:23:02 Scmbug ERROR> 
BugMail.pm:78:Bugzilla::BugMail::AUTOLOAD - Goto undefined subroutine 
&main::GetVersionTable at /var/www/html/bugzilla/Bugzilla/BugMail.pm line 78, 
<STDIN> line 34. Thanks.> Subject: Re: [scmbug-users] 
[email protected]> From: [email protected]> To: 
[email protected]> CC: [email protected]> Date: Tue, 16 Dec 2008 
14:06:59 -0700> > Hi Roudy,> > This is a known issue. There's probably some 
Bugzilla function we should> be calling to take care of sending the emails, and 
we are not calling it> yet.> > 
http://bugzilla.mkgnu.net/show_bug.cgi?id=832#c6> > On Tue, 2008-12-16 at 18:04 
+0000, Roudy Veve wrote:> > Hi All,> > > > I performed the subversion and 
bugzilla integration on a linux box> > using scmbug-0.26.9> > everything looks 
fine, but the only problem is when I do a commit to> > the svn repository,> > I 
see the scmbug comment posted in bugzilla bug report, but no email> > is sent 
to bugzilla > > user like it is normally sent when you post a comment using 
bugzilla> > web interface.> > > > is there any workaround to this issue. I do 
not want to enable scmbug> > "Integration Activity" > > email. I want the Email 
to be sent from bugzilla like does any other> > comment.> > > > Thanks.> > > > 
> > ______________________________________________________________________> > 
Send e-mail faster without improving your typing skills. Get your> > HotmailĀ® 
account.> > _______________________________________________> > scmbug-users 
mailing list> > [email protected]> > 
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users



Send e-mail faster without improving your typing skills. Get your HotmailĀ® 
account.
_________________________________________________________________
You live life online. So we put Windows on the web. 
http://clk.atdmt.com/MRT/go/127032869/direct/01/
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to