trac使用经验两则

最近开始使用trac进行项目管理,和svn同步。使用过程中解决了两个并不常见的问题,贴出来和大家分享。

  • 如何修改trac的assign to下拉列表
  • 让trac的ticket和bugzilla有同样的状态

如何修改trac的assign to下拉列表

trac ticket的assign to下拉列表中的名单,没有保存在配置文件里头。读一下TracFaq有下面发现:

This will change the Assign To ticket filed into a select box that only contains existing users. However as it says on the TracTickets page, the user must have logged, in at least once, and set their email address.

If you run multiple Trac sites, and have a set of common users across all Trac sites, it gets annoying to have to log into each one and set the email.

So, what is one to do? Well, there are two things that need to be entered into the database: a session record, and an email record.

所以我们只需要对trac的session表做操作就可以修改assign to的下拉菜单列表。session的表结构如下:

Table "session"
Column         | Type    | Modifiers
---------------+---------+-----------
sid            | text    | not null
authenticated  | integer | not null
last_visit     | integer |

让trac的ticket和bugzilla有同样的状态

缺省配置下,trac ticket的状态和bugzilla的bug状态不一样,只有new,fixed,invalid,wontfix,duplicate,worksforme这几种。在trac 0.11之后,可以自己定义workflow,只需要将trac.ini的[ticket-workflow]章节修改一下,就可以支持verify状态:


accept = new -> assigned
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
reassign = new,assigned,reopened -> new
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reopen = resolved,verified,closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = new,assigned,reopened -> resolved
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY
verify = resolved -> verified
verify.permissions = TICKET_MODIFY
close = verified -> closed
close.permissions = TICKET_MODIFY

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值