Trac + SVN on CentOS4^3

明日から短い夏休み。そんなわけでなおさら退廃ムードが漂うオイラの周り。エロイ人もいないし当然といえば当然。今日もTracで時間つぶすか(をぃ。

さて現行のtrac0.9に追加したのは以下の機能。これはそのまま使いたいから、0.11ではどうするか調べないと。

  • webadmin
  • Resolutionの日本語化
  • Ticketの日付管理
  • 担当者をコンボボックスから選べるようにする

追加は

  • AccountManager
  • IniAdmin
  • WebAdminUsers

あたりが定番なのか?

webadmin

0.11ではtrac本体に含まれているため追加install不要。管理者権限を与えるだけで、画面右上に「管理」というメニュー項目が現れる。そこから入れる。

trac-admin /var/www/trac/[project] permission add <username> TRAC_ADMIN

Resolutionの日本語化

webadminの「解決方法」で変更できる。

Ticketの日付管理

なんとTracGanttが0.11に対応していない模様(see http://willbarton.com/code/tracgantt/)。0.9時代も使っていたように見えないからまぁいいか。参考までにTracGanttに問題なければ以下の手順でうまくいくはず

#wget http://willbarton.com/files/TracGantt-0.3.2a-py2.3.egg
#easy_install --always-unzip TracGantt-0.3.2a-py2.3.egg

してからtrac.iniへ以下を追加。

[components]
tracgantt.* = enabled

[ticket-custom]
due_assign = text
due_assign.label = 開始予定日
due_assign.value = YYYY/MM/DD

dependencies = text
dependencies.label = 依存タスクNo
dependencies.value =

due_close= text
due_close.label = 終了予定日
due_close.value = YYYY/MM/DD

include_gantt = checkbox
include_gantt.label = ガントチャートに表示
include_gantt.value =

[gantt-charts]
# The format of dates entered by humans in the above ticket fields
date_format = %Y/%m/%d

# Include the ticket summary in the gantt chart display
include_summary = true

# Trim the included summary to the given number of characters
summary_length = 16

# Use the creation date of a ticket as the "due assign" date if no
# assignment date is given
use_creation_date = true

# Show on the gantt chart the date the ticket was opened, to contrast
# with the assignment date.
show_opened = true

担当者をコンボボックスから選べるようにする

[ticket]
restrict_owner = true

AccountManager

本家のサイト→http://trac-hacks.org/wiki/AccountManagerPluginをみると

For Trac 0.11 (doesn't currently work with 0.11.4, see #4125):

だって。まぁいいか。

IniAdmin

trac.iniを編集するためのプラグイン。ここ→http://trac-hacks.org/wiki/IniAdminPluginから0.11用を取得。installは、

# cd 適当なディレクトリ→ここへプラグインをDownload
# unzip iniadminplugin_0.11-r6371.zip
# cd iniadminplugin/0.11/
# python setup.py install

trac.iniへ以下を追加。

[components]
iniadmin.iniadmin.iniadminplugin = enabled

で、サーバ再起動で出来上がり。adminでログインして[管理]を選べば、画面左側にtrac.iniのセクション名が表示されるので、それをクリックすると...エラーorz。

Trac detected an internal error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 4: ordinal not in range(128)

ぐぐってみるとhttp://trac-hacks.org/ticket/4179からパッチ(nonasciidoc-0.11_r3915.patch)を入手してあててやらないとダメっぽい。

なので展開したiniadminplugin以下を削除して(念のため)やり直し。

# cd 適当なディレクトリ→ここへプラグインをDownload
# unzip iniadminplugin_0.11-r6371.zip
# cd iniadminplugin/0.11/
# wget -O nonasciidoc-0.11_r3915.patch 'http://trac-hacks.org/attachment/ticket/4179/nonasciidoc-0.11_r3915.patch?format=raw'
# patch -p0 <nonasciidoc-0.11_r3915.patch# python setup.py install

これで再起動すればOK。エラーは消えて、パラメータの内容が日本語で表示される。超・便利。

WebAdminUsers

http://trac-hacks.org/wiki/WebAdminUsersPluginを見るとAccountManagerが必要らしい。ここではinstallしないのであきらめるか。

次はワークフロー。ここは時間かかりそうだな。