[vhffs-dev] [853] Added notify_from support, fixed vhffs_post_commit script ( we should move this file elsewhere)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 853
Author:   gradator
Date:     2007-09-01 01:51:58 +0000 (Sat, 01 Sep 2007)

Log Message:
-----------
Added notify_from support, fixed vhffs_post_commit script (we should move this file elsewhere)

Modified Paths:
--------------
    trunk/vhffs-backend/conf/vhffs.conf.dist.in
    trunk/vhffs-panel/svn/prefs.pl
    trunk/vhffs-panel/svn/prefs_save.pl
    trunk/vhffs-robots/misc/vhffs_post_commit.pl


Modified: trunk/vhffs-backend/conf/vhffs.conf.dist.in
===================================================================
--- trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-08-31 19:04:52 UTC (rev 852)
+++ trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-09-01 01:51:58 UTC (rev 853)
@@ -318,6 +318,9 @@
 		# the url scheme is svnweb_url/svn_$group_$svnname/ , change the code or modify the software used
 		svnweb_url	=	"http://svnweb.hoster";
 
+		# From: of emails sent by svn commit notifier
+		notify_from	=	subversion@xxxxxxxxx
+
 		# URL to the documentation (optional)
 		url_doc		=	http://help.myhoster.net/svn
 	</svn>

Modified: trunk/vhffs-panel/svn/prefs.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs.pl	2007-08-31 19:04:52 UTC (rev 852)
+++ trunk/vhffs-panel/svn/prefs.pl	2007-09-01 01:51:58 UTC (rev 853)
@@ -136,13 +136,7 @@
 
     $template->param( TITLE_OPT => gettext('Options') );
     $template->param( TEXT_OPT_ML => gettext('Notify changes on mailing-list :'));
-
-    if ( $svn->{ml_name} ne '' )
-    {
-        $template->param( TEXT_ML_NAME => $svn->{ml_name});
-    } else {
-    	$template->param( TEXT_ML_NAME => gettext('ml adress here...') );
-    }
+    $template->param( TEXT_ML_NAME => $svn->{ml_name} );
     
     if( $svn->is_public == 1 )
     {

Modified: trunk/vhffs-panel/svn/prefs_save.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs_save.pl	2007-08-31 19:04:52 UTC (rev 852)
+++ trunk/vhffs-panel/svn/prefs_save.pl	2007-09-01 01:51:58 UTC (rev 853)
@@ -112,7 +112,7 @@
         }
     }
 
-    if ( defined $ml_name && ( $ml_name ne gettext('ml adress here...'))) {
+    if ( defined $ml_name ) {
         if(Vhffs::Functions::valid_mail($ml_name) > 0) {
             $svn->{ml_name} = $ml_name;
             if( $svn->commit_option < 0 ) {

Modified: trunk/vhffs-robots/misc/vhffs_post_commit.pl
===================================================================
--- trunk/vhffs-robots/misc/vhffs_post_commit.pl	2007-08-31 19:04:52 UTC (rev 852)
+++ trunk/vhffs-robots/misc/vhffs_post_commit.pl	2007-09-01 01:51:58 UTC (rev 853)
@@ -46,27 +46,33 @@
 use Vhffs::Functions;
 use Vhffs::Services::Svn;
 
-my $vhffs        = init Vhffs::Main;
-my $repo_path    = $ARGV[0];
-my $repo         = basename($ARGV[0]);
-my $rev          = $ARGV[1];
-my $svn          = Vhffs::Services::Svn::get_by_reponame( $vhffs , $repo );
-my $from         = Vhffs::Conf::get_master_mail();
-my $notifier;
+my $repopath = $ARGV[0];
+my $rev = $ARGV[1];
+exit 1 unless ( defined $repopath && defined $rev );
 
+my $vhffs = init Vhffs::Main;
+exit 1 unless defined $vhffs;
+
+my $svnconf = $vhffs->get_config->get_service('svn');
+
+$repopath =~ s#/$##;
+( undef , my $reponame ) = ( $repopath =~ /(^.+\/)([a-z0-9]+\/[a-z0-9]+$)/ );
+
+my $svn = Vhffs::Services::Svn::get_by_reponame( $vhffs , $reponame );
+exit 1 unless defined $svn;
+
 # MODE : mailinglist
-if ($svn->{ml_name} ne '')
+if( $svn->{ml_name} ne '' )
 {
-        my %params;
-	%params->{'repos_path'}   = $repo_path;
-	%params->{'revision'}     = $rev;
-	%params->{'from'}         = $from;
-	%params->{'to'}           = $svn->{ml_name};
-	%params->{'with_diff'}    = 1;
-        %params->{'attach_diff'}  = 1;
+	my %params;
+	%params->{'repos_path'} = $repopath;
+	%params->{'revision'} = $rev;
+	%params->{'from'} = $svnconf->{'notify_from'};
+	%params->{'to'} = $svn->{ml_name};
+	%params->{'with_diff'} = 1;
+	%params->{'attach_diff'}  = 1;
 
-	$notifier = SVN::Notify->new(%params);
-
+	my $notifier = SVN::Notify->new(%params);
 	$notifier->prepare;
 	$notifier->execute;
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/