20070731 SVNNOTIFY FAIL
http://www.yippeesoft.com

问题一大堆
好像中文UNICODE支持不行~~
 Cannot decode string with wide characters

Wide character in subroutine entry at D:/SVNADDON/Perl/lib/Encode.pm line 186.

 The content my post-commit.bat file (located in the
c:\\repositories\\repos1 folder) is :
————————
SET PATH=C:\\perl\\bin
SET OS=Windows_NT
SET SystemRoot=C:\\WINDOWS

svnnotify –repos-path c:\\repositories\\repos1 -r 1
–to david_75017@yahoo.fr –smtp mysmtpserver -H
HTML::ColorDiff -d

[quote]
trac的ticket notification

半作弊条性质。

找到trac环境目录。

进入其下的conf,揪出trac.ini
编辑,找到下面的段落替换为类似的内容

[notification]
always_notify_owner = true
smtp_always_cc = !!你的邮件列表名字!!
smtp_password = !!密码!!
smtp_enabled = yes
smtp_replyto = !!回复给谁?通常是管理员或留空!!
smtp_port = 25
always_notify_reporter = yes
smtp_server = !!邮件服务器名字!!
smtp_from = !!邮件以谁的身份发出?通常是trac管理员!!
smtp_user = !!登录邮件服务器的用户名!!

调试:


[logging]
log_file = trac.log
log_level = DEBUG
log_type = none
中的log_type=改为= file,然后去log/trac.log蹲点。调好改回。

[/quote]

[quote]

前几天写了linux版的,受广大论友的邀请,特写此windows的版本,希望大家能够共同为此论坛作出贡献,也希望越来越多的人能够更加方便地使用SVN。

OS: Windows XP SP2

1) 安装Apache Server
2) 安装SVN
3) 配置邮件通知以及修改log权限

1. 安装apache2.0.59,从这里可以下载到http://apache.justdn.org/httpd/binaries/win32/apache_2.2.3-win32-x86-no_ssl.msi
安装过程中设置以下参数:
Network Domain: localhost
Server name: localhost
Administrator\’s Emai Address: windymax@126.com
安装到默认路径为C:\\Program Files\\Apache Group\\Apache2

2. 安装subversion1.4.0,从这里下载http://www.iusesvn.com/bbs/download/svn-win32-1.4.0.zip
安装到默认路径为C:\\Program Files\\Subversion
默认安装后,在apache的配置文件中会自动加入以下两行。
LoadModule dav_svn_module "C:/Program Files/Subversion/bin/mod_dav_svn.so"
LoadModule authz_svn_module "C:/Program Files/Subversion/bin/mod_authz_svn.so"
把这行的注释去掉
LoadModule dav_fs_module modules/mod_dav_fs.so

拷贝C:\\Program Files\\Subversion\\bin下的libdb44.dll到这个目录下C:\\Program Files\\Apache Group\\Apache2\\bin
打开apache的配置文件在末尾处加入以下参数:
<Location /svn>
DAV svn
SVNPath d:\\svndata\\test
AuthType Basic
AuthName "Windy SVN"
AuthUserFile d:\\svndata\\test\\passwd
Require valid-user
</Location>
保存。(在这里权限文件我不多讲了,大家多做实验就明白了)

建立仓库
打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
C:\\Documents and Settings\\windy> d:   //进入D盘(因为我们要在D盘下创建仓库)
D:\\> md svndata   //创建一个名叫svndata的目录
D:\\> c:   //进入C盘
C:\\Documents and Settings\\windy> cd\\   //退到C盘根目录
C:\\Documents and Settings\\windy> cd C:\\Program Files\\Subversion\\bin  //进入subversion/bin目录
C:\\Program Files\\Subversion\\bin> svnadmin create d:\\svndata\\test   //用svnadmin命令创建名为test的仓库(这条命令成功后,在test下会出现很多文件夹和文件)
C:\\Program Files\\Subversion\\bin> cd C:\\Program Files\\Apache Group\\Apache2\\bin   //进入apache\\bin目录
C:\\Program Files\\Apache Group\\Apache2\\bin> htpasswd -cm d:\\svndata\\test\\passwd user1   //用htpasswd命令创建第一个用户(user1),同时生成密码认证文件,c参数为create,m参数为MD5加密方式
New password: ******
Re-type new password: ******
Adding password for user user1   //加入用户成功
C:\\Program Files\\Apache Group\\Apache2\\bin> htpasswd -m d:\\svndata\\test\\passwd user2   //用htpasswd命令创建第二个用户(user2),注意如果在这时加入c参数会覆盖掉之前创建的用户及文件。
New password: ******
Re-type new password: ******
Adding password for user user2   //加入用户成功

重新启动apache,进行测试。
用IE打开http://localhost/svn,这时应该可以看到
Revision 0: /
——————————————————————————–
Powered by Subversion version 1.4.0 (r21228).    //说明我们已经配置成功了

3. 配置邮件通知以及修改log权限
下载所需要的软件包
–在这里下载http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.819-MSWin32-x86-267479.msi到D盘根目录下。
–下载http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe到D盘根目录下。
–下载http://search.cpan.org/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.2805.tar.gz到D盘根目录下,将Module-Build-0.2805.tar.gz解压到D盘。
–下载http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Authen-SASL-2.10.tar.gz到D盘根目录下,将Authen-SASL-2.10.tar.gz解压到D盘。
–下载http://search.cpan.org/CPAN/authors/id/A/AP/APLEINER/Net-SMTP_auth-0.08.tar.gz到D盘根目录下,将Net-SMTP_auth-0.08.tar.gz解压到D盘。
–下载http://search.cpan.org/CPAN/authors/id/D/DW/DWHEELER/SVN-Notify-2.64.tar.gz到D盘根目录下,将SVN-Notify-2.64.tar.gz解压到D盘。

开始安装Perl以及模块
–安装Active Perl,一路默认安装,默认路径为C:\\Perl
–测试perl是否正常工作(这步很关键)
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
   C:\\Documents and Settings\\windy> perl   //如果没有报错,说明已经正常工作,因为安装perl时,安装程序会自动设置好环境perl(如果在系统环境变量中没有自动添加,需手动添加perl 变量环境),具体做法是:
  "回到桌面" -> "鼠标右键我的电脑" -> "属性" -> "高级" -> "环境变量" -> "系统变量中Path最前面中添加C:\\Perl\\bin\\;" ->"完成"。   //测试,如果报错,请重新启动电脑后进行测试。
–将nmake15.exe改名为nmake.exe后拷贝到c:\\windows\\system32目录下。
–测试nmake是否是否正常工作(这步很关键)
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
   C:\\Documents and Settings\\windy> nmake  
  Microsoft (R) Program Maintenance Utility   Version 1.50
  Copyright (c) Microsoft Corp 1988-94. All rights reserved.   //说明nmake已经正常工作
–安装Module-Build模块
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\\Documents and Settings\\windy> d:
  D:\\> cd Module-Build-0.2805
  D:\\Module-Build-0.2805> perl Build.PL   //收集系统环境变量
  D:\\Module-Build-0.2805> Build   //进行编译
  D:\\Module-Build-0.2805> Build test   //测试
  D:\\Module-Build-0.2805> Build install   //编译后安装 
–安装Perl模块Authen::SASL,进入Authen-SASL-2.10目录,首先开打Makefile.PL
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\\Documents and Settings\\windy> d:
  D:\\> cd Authen-SASL-2.10
  D:\\Authen-SASL-2.10> perl Makefile.PL   //收集系统环境变量
  出现选择安装提示,y和n先后安装一次
  D:\\Authen-SASL-2.10> nmake   //进行编译
  D:\\Authen-SASL-2.10> nmake test  //进行测试
  D:\\Authen-SASL-2.10> nmake install   //编译后安装
–安装Perl模块Net::SMTP_auth
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\\Documents and Settings\\windy> d:
  D:\\> cd Net-SMTP_auth-0.08
  D:\\Net-SMTP_auth-0.08> perl Makefile.PL   //收集系统环境变量
  D:\\Net-SMTP_auth-0.08> nmake   //进行编译
  D:\\Net-SMTP_auth-0.08> nmake test   //测试
  D:\\Net-SMTP_auth-0.08> nmake install   //编译后安装
–安装Perl模块SVN::Notify
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\\Documents and Settings\\windy> d:
  D:\\> cd SVN-Notify-2.64
  D:\\SVN-Notify-2.64> perl Build.PL   //收集系统环境变量
  D:\\SVN-Notify-2.64> Build   //进行编译
  D:\\SVN-Notify-2.64> Build test   //测试
  D:\\SVN-Notify-2.64> Build installl   //编译后安装 
–安装完毕。

设置邮件通知
–拷贝post-commit.tmpl为post-commit.bat
–删除末尾参数,增加下面参数:
set REPOS=%1
set REV=%2
SET PATH=C:\\PERL\\BIN;
SET OS=Windows_NT
SET SystemRoot=C:\\WINDOWS
svnnotify –repos-path %REPOS% -r %REV% –to windy@126.com –smtp smtp.126.com -H HTML::ColorDiff -d –subject-prefix [Windy SVN]
//–to要跟你要发送给谁的邮件地址,–smtp后跟你自已的邮件服务器地址,比如mail.126.com

设置log可以修改
–拷贝pre-revprop-change.tmpl为pre-revprop-change.bat
–删除末尾参数,增加下面参数:
REM SVN pre-revprop-change hook allows edit of logmessages from TSVN

setlocal
set REPOS=%1
set REV=%2
set USER=%3
set PROPNAME=%4
set ACTION=%5

if  not "%ACTION%"=="M" goto refuse
if  not "%PROPNAME%"=="svn:log" goto refuse
goto OK

:refuse
echo Cann\’t set %PROPNAME%/%ACTION%, only svn:log is allowed 1>&2
endlocal
exit 1

:OK
endlocal
exit 0

完成所有设置,开始测试。

[/quote]

历史博文

标签:, , ,
五月 4, 2008 at 8:34 上午 by yippee 1,016 次
Category: Info
Tags: , , ,