打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
BugzillaExtension

Bugzilla Extension

This extension is currently being distributed along with Mercurial.

Author: Jim Hague, Vadim Gelfer

1. Overview

This hook extension adds comments on bugs in Bugzilla when changesets that refer to bugs by Bugzilla ID are seen. The comment is formatted using the Mercurial template mechanism.

The bug references can optionally include an update for Bugzilla of the hours spent working on the bug. Bugs can also be marked fixed.

This extension works with Bugzilla v3.4 and later. Marking bugs fixed may require Bugzilla 4.0 and later.

2. Configuration

To use this extension, enable it in the configuration file (hgrc) like this:

[extensions]hgext.bugzilla =[hooks]# run bugzilla hook on every change pulled or pushed in hereincoming.bugzilla = python:hgext.bugzilla.hook

To configure the 'bugzilla' extension you add items to '[bugzilla]' section of hgrc.

You need to configure access to your Bugzilla instance, and the method used for updating Bugzilla, which can be either XMLRPC or XMLRPC+email.

Access via XMLRPC needs a Bugzilla username and password to be specified in the configuration. Comments are added under that username. Since the configuration must be readable by all Mercurial users, it is recommended that the rights of that user are restricted in Bugzilla to the minimum necessary to add comments. Marking bugs fixed requires Bugzilla 4.0 and later.

Access via XMLRPC/email uses XMLRPC to query Bugzilla, but sends email to the Bugzilla email interface to submit comments to bugs. The From: address in the email is set to the email address of the Mercurial user, so the comment appears to come from the Mercurial user. In the event that the Mercurial user email is not recognized by Bugzilla as a Bugzilla user, the email associated with the Bugzilla username used to log into Bugzilla is used instead as the source of the comment. Marking bugs fixed works on all supported Bugzilla versions.

A minimal configuration using XMLRPC looks like this:

[bugzilla]version=xmlrpcbzurl=http://bugzilla.example.comuser=bugs                          # Username to use to log into Bugzilla, default 'bugs'.password=...                       # User password.

For full details of the available configuration settings, use the Mercurial help.

hg help bugzilla

2.1. Configuration with XMLRPC/email

[bugzilla]version=xmlrpc+emailbzurl=http://bugzilla.example.comuser=bugs                          # Username to use to log into Bugzilla, default 'bugs'.password=...                       # User password.bzemail=bugzilla@example.com       # Address for emails to Bugzilla.

When using XMLRPC/email, you can specify mappings of Mercurial committers to Bugzilla users.

[bugzilla]usermap = filename # cfg file with "committer"="bugzilla user" info[usermap]committer_email = bugzilla_user_name

In addition, the Mercurial email settings must be configured. See the documentation in hgrc(5), sections [email] and [smtp].

2.2. Other common configuration settings

[bugzilla]regexp=...              # Regular expression to match bug IDs for update in changeset commit message.fixregexp=...           # Regular expression to match bug IDs to mark fixed in changeset commit message.fixstatus=RESOLVED      # Bug status to use when marking bug fixed.fixresolution=FIXED     # Bug resolution to use when marking bug fixed.style=...               # Style file to use when formatting comments for Bugzilla.template=...            # Template to use when formatting comments. Overrides style.strip=0                 # Separator characters to strip from Mercurial repository path to get web root.baseurl=...             # Web root for browsing Mercurial repository.

2.3. Example configuration settings

2.3.1. XMLRPC

XMLRPC example configuration. This uses the Bugzilla at http://my-project.org/bugzilla, logging in as user bugmail@my-project.org with password plugh. It is used with a collection of Mercurial repositories in /var/local/hg/repos/, with a web interface at http://my-project.org/hg.

[bugzilla]bzurl=http://my-project.org/bugzillauser=bugmail@my-project.orgpassword=plughversion=xmlrpctemplate=Changeset {node|short} in {root|basename}.         {hgweb}/{webroot}/rev/{node|short}\n         {desc}\nstrip=5[web]baseurl=http://my-project.org/hg

2.3.2. XMLRPC+email

XMLRPC+email example configuration. This uses the Bugzilla at http://my-project.org/bugzilla, logging in as user bugmail@my-project.org with password plugh. It is used with a collection of Mercurial repositories in /var/local/hg/repos/, with a web interface at http://my-project.org/hg. Bug comments are sent to the Bugzilla email address bugzilla@my-project.org.

[bugzilla]bzurl=http://my-project.org/bugzillauser=bugmail@my-project.orgpassword=plughversion=xmlrpc+emailbzemail=bugzilla@my-project.orgtemplate=Changeset {node|short} in {root|basename}.         {hgweb}/{webroot}/rev/{node|short}\n         {desc}\nstrip=5[web]baseurl=http://my-project.org/hg[usermap]user@emaildomain.com=user.name@bugzilladomain.com

3. Usage

This extension doesn't need user interaction to run.


CategoryBundledExtension CategoryBugtrackingExtensions

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux(rhel5,centos5)下安装Bugzilla指南
mac上使用hg命令
codeStriker(及与svn、bugzilla集成)使用过程记录
Software Testing-Answers to Quiz Questions(五)
access Mercurial over ssh tunnel (相忘于江湖)
Solidot | Python选择Mercurial Hg版本控制系统
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服