SVN (Subversion)是一套免費 version control 軟體,按照Trac on Windows Installation,嘗試著整合 svn 和 trac。很麻煩,還要安裝python及一些其它的plugin,裝過一次就不會再想裝第二次。透過google想尋求其它的bug tracking software,Fabrice's weblog列了一些,不過只有平台,沒有language、License等資訊,最好有不同 bug tracking 軟體的比較。Fabrice's weblog所列的See also給了想要的答案Comparison: Web-based Tracker。最後選擇了Mantis,因為Mantis免費且基於php + mysql,容易安裝。
My Mantis設定,其它設定參考別人的blog 博客園
-
// MySQL 設定
-
$g_hostname = 'localhost';
-
$g_db_type = 'mysql';
-
$g_database_name = 'mantis';
-
$g_db_username = '****';
-
$g_db_password = '****';
-
-
// Send Mail 設定
-
$g_phpMailer_method = 2; // PHPMailer 以 SMTP 方式傳送
-
$g_smtp_host = 'ms1.hinet.net'; // whatever you smtp server is
-
$g_webmaster_email = 'mymail@gmail.com'; //網站管理者email
-
$g_stop_on_errors = ON;
-
-
// Integration with SVN 設定
-
$g_source_control_notes_view_status = VS_PUBLIC;
-
$g_source_control_account = 'administrator';
-
$g_source_control_set_status_to = OFF;
-
// commit時填寫message的格式
-
$g_source_control_regexp = "/\bissue [#]{0,1}(\d+)\b/i";
-
-
//設定 jpgraph 外掛
-
$g_use_jpgraph = ON; //打開jpgraph外掛
-
$g_jpgraph_path = '../mantis/jpgraph/src/'; //jpgraph 外掛的路徑
-
-
//設定時間
-
$g_complete_date_format = 'm-d-y H:i'; //時間顯示格式,避免秀出中文亂碼
參考Source Control Integration,編輯YourRepos\hooks\post-commit.bat,加入
-
SET REPOS=%1
-
-
SET REV=%2
-
SET DETAILS_FILE=svnfile_%REV%
-
SET LOG_FILE=svnfile_%REV%_Log
-
-
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%
-
-
C:\APMXE4\php4\php.exe C:\APMXE4\htdocs\mantis\core\checkin.php <%DETAILS_FILE%>%LOG_FILE%
-
DEL %DETAILS_FILE%
-
DEL %LOG_FILE%
-
rem@echo off
-
rem
-
rem
-
rem if "%1"=="" goto usage
-
rem if "%2"=="" goto usage
-
rem
-
rem
-
rem svnlook log "%1" -r %2 | php -f d:\www\mantis\core\checkin.php
-
rem
-
rem
-
rem goto theend
-
rem
-
rem
-
rem :usage
-
rem echo Usage: add_issue_note PATH_TO_REPOSITORY REVISION
-
rem goto theend
-
rem
-
rem
-
rem :theend
爾後svn commit時,填入的訊息依照格式
issue 數字 message
就會順便寫入mantis,其中數字表示在mantis中第幾個issue(編號),如下圖 
當我commit時填寫 issue 1 : convert unicode to gb,在mantis就會出現

其結果就是hook bat 的output。
在Mantis依序點選「檢視Bug」->「0000002」->「更新Bug」->「進階更新」
會來到如下圖畫面

若「分析」= 「已修正」且「已修正版本」有值,則ChangeLog會work 
已修正版本需在建立Project時就要指定欲Release的版本編號