ThomasZhang 发表于 2007-4-12 09:43:56

CVS与Mantis集成的问题

sdlkfj7 最近在使用Mantis,这个缺陷跟踪工具不错,细读了其说明书,发现可以与CVS集成,但是相关的集成方法介绍的章节比较少. 其中提到了commitinfo这个文件,我在CVS中没有找到,也不知何如配置.我是在windows XP装的服务,请了解的给我一些启发,谢谢!

云层 发表于 2007-4-17 11:25:37

要集成Mantis和SVN,需要几个工具:

SVN客户端,有个windows下的很不错的工具,TortoiseSVN,完全集成在explorer里,下载地址: http://tortoisesvn.net/

SVN服务端,这个应该都有吧。

Mantis缺陷跟踪系统,用php开发。轻量级的缺陷跟踪系统。 http://www.mantisbt.org/

首先先在TortoiseSVN里设置一下项目的属性,右键点击目录,属性,在subversion一栏里,加入这几个属性

bugtraq:label = issue
bugtraq:url = http://<mantisserver>/mantis/view.php?id=%BUGID%
bugtraq:message = issue %BUGID%
bugtraq:warnifnoissue = true

到对应的SVN版本库里,找到hooks目录,建立一个post-commit.bat文件,将以下内容拷入:

REM Post-commit hook for MantisBT integration
SET REPOS=%1
SET REV=%2
SET DETAILS_FILE=E:\svnrepo\log\svnfile_%REV%
SET LOG_FILE=E:\svnrepo\log\svnfile_%REV%_Log
set APR_ICONV_PATH=F:\software\svn-win32-1.4.2\iconv
set path=%path%;e:\software\php;F:\software\svn-win32-1.4.2\bin;


echo ****** Source code change ******>>%DETAILS_FILE%
svnlook log -r %REV% %REPOS%>>%DETAILS_FILE%
echo SVN Revision:%REV%>>%DETAILS_FILE%
svnlook diff -r %REV% %REPOS%>>%DETAILS_FILE%

php.exe E:\www\mantis\core\checkin.php <%DETAILS_FILE% >%LOG_FILE%
DEL %DETAILS_FILE%
DEL %LOG_FILE%

最后,修改mantis安装目录下的config_inc.php,加入以下内容(mantis系统里要有SVN用户):

$g_source_control_notes_view_status = VS_PUBLIC;
$g_source_control_account = 'SVN';
$g_source_control_set_status_to = OFF;
$g_source_control_regexp = "/\bissue [#]{0,1}(\d+)\b/i";

完成这些步骤后,就可以在SVN提交新版本时,同时发布内容到对应的缺陷跟踪系统了。

比如,修改了一个源文件,svn commit时,在右上的issue栏目里输入要提交到的具体的 issue/bug编号,然后在下面的message框内输入具体的描述,svn的hook就会自动往mantis里对应的条目里写入你提交时输入的这些内容。




Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1510684

云层 发表于 2007-4-17 11:32:12

About CVS
CVS (Concurrent Versions System) is a tool used by many software developers to manage changes within their source code tree. CVS provides the means to store not only the current version of a piece of source code, but a record of all changes (and who made those changes) that have occurred to that source code. Use of CVS is particularly common on projects with multiple developers, since CVS ensures changes made by one developer are not accidentally removed when another developer posts their changes to the source tree.

Information about accessing this CVS repository may be found in our document titled, "CVS (Version Control for Source Code)".

In order to access a CVS repository, you must install a special piece of software called a CVS client. CVS clients are available for most any operating system. Information about CVS client software may be found in our document titled, "Recommended User Software Configuration".



Anonymous CVS Access

This project's SourceForge.net CVS repository can be checked out through anonymous (pserver) CVS with the following instruction set. The module you wish to check out must be specified as the modulename. When prompted for a password for anonymous, simply press the Enter key. To determine the names of the modules created by this project, you may examine their CVS repository via the provided web-based CVS repository viewer.

cvs -d:pserver:anonymous@mantisbt.cvs.sourceforge.net:/cvsroot/mantisbt login

cvs -z3 -d:pserver:anonymous@mantisbt.cvs.sourceforge.net:/cvsroot/mantisbt co -P modulename

Information about accessing this CVS repository may be found in our document titled, "CVS (Version Control for Source Code)".

Updates from within the module's directory do not need the -d parameter.

NOTE: UNIX file and directory names are case sensitive. The path to the project CVSROOT must be specified using lowercase characters (i.e. /cvsroot/mantisbt)



Developer CVS Access via SSH

Only project developers can access the CVS tree via this method. A SSH client must be installed on your client machine. Substitute modulename and developername with the proper values. Enter your site password when prompted.

Project administrators may limit CVS access to this repository using cvs_acls or the CVS access member permissions option. Developers may verify their CVS access status on the admin page for this project.

A significant amount of information about project CVS services may be found in our "CVS (Version Control for Source Code)".

Developers may also make use of shared SSH keys for authentication.

export CVS_RSH=ssh

cvs -z3 -d:ext:developername@mantisbt.cvs.sourceforge.net:/cvsroot/mantisbt co -P modulename

NOTE: UNIX file and directory names are case sensitive. The path to the project CVSROOT must be specified using lowercase characters (i.e. /cvsroot/mantisbt)

这应该对你有些帮助

ThomasZhang 发表于 2007-4-18 09:15:40

感谢云层的帮助

感谢云层的帮助

sidenf 发表于 2007-4-29 17:43:18

cvs也有缺陷跟踪工具工具,可以和cvs无逢接合,cvstrac呀,干吗不用
页: [1]
查看完整版本: CVS与Mantis集成的问题