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

Re: mailer.py for Windows

From: steven higgan <steven.higgan_at_gmail.com>
Date: Thu, 12 Feb 2009 08:39:02 +1300

maybe you can use this ps scrip (powershell) as somewhere to start.

I doubt this will run first time (compiled in gmail) but give it a go.

this goes in your post_commit.bat
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
c:\my_own_mailer.ps1 "%1" "%2"

this goes in my_own_mailer.ps1
$svn_repos = $args[0]
$svn_rev = $args[1]
$name = $args[2]

# global settings
$global_configuration_file = "c:\path\to\config.xml"

# remember some stuff
$smtp_server = ([xml] (get-content
$global_configuration_file)).Configuration.SmtpServer
$smtp_to = ([xml] (get-content $global_configuration_file)).Configuration.SmtpTo
$smtp_from = ([xml] (get-content
$global_configuration_file)).Configuration.SmtpFrom

if ($name -eq $null) { $name = $svn_repos}

$author = svnlook author $svn_repos--revision $svn_rev
$email_subject_summary= "Subversion Commit: ($author) $name at ($svn_rev)"

$email_body= ""

foreach($svnlook_log_line in svnlook log $svn_repos--revision
$svn_rev) { if($svnlook_log_line -ne "") { $email_body+=
$svnlook_log_line + "`n" } }

if ($email_body-ne "") { $email_body+= "`n`n" }

foreach($svnlook_changed_line in svnlook changed $svn_repos--revision
$svn_rev) { $email_body+= $svnlook_changed_line + "`n" }

# send the log
$msg = new-object Net.Mail.MailMessage
$msg.From = $smtp_from
$msg.To.Add($smtp_to)
$msg.Subject = $email_subject_summary
$msg.Body = $email_body
$smtp = new-object Net.Mail.SmtpClient($smtp_server)
$smtp.Send($msg)

On Thu, Feb 12, 2009 at 12:29 AM, dieter oberkofler
<doberkofler.lists_at_gmail.com> wrote:
>
> I would like to use the mailer.py script to automatically send Email after
> commit from my SVN repository running on a Windows Host.
> I seems as if mailer.py would only run on Linux and I was wondering if there
> are other ways to do this or if someone has already "ported" the script to
> Windows.
> Thank you,
> D
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1138561
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1140487

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-02-11 20:45:00 CET

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.