TFS Extension

Author: Matt Hawley

Web page: http://hgtfshook.codeplex.com/

Repository: https://hg01.codeplex.com/hgtfshook

Updated plugin: Repository: https://bitbucket.org/AngelEzquerra/hgtf

Overview

This extension automatically updates Team Foundation Server work items when there's a reference to a work item id inside changesets.

The hook does not change bug status, it currently only adds comments.

Configuration

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

[extensions]
tfs = /path/to/tfs.py

[hooks]
# run the hook on every change that is pushed or pulled in here
incoming.tfs = python:tfs.hook

The extension is configured through a configuration section. The following keys are recognized in the [tfs] section:

Required Values

Key

Value

host

The Team Foundation Server URL that you connect with.

user

The user name used to authenticate with the Team Foundation Server.

password

The password used to authenticate with the Team Foundation Server.

Optional Values

Key

Value

Default

regexp

This is the regex that is used to extract work item ids that should be updated when the hook runs. It must contain only one capturing "()" group that surrounds the bug ids.

(?is)Work ?Items?: (.+)$

template

Template to use when formatting the comment added to the work item. This will override the default template used. Keywords include the usual Mercurial keywords.

Fixed in revision {node|short}.

The [tfs.columns] section is used to specify additional columns that are also written to when updating a work item template.

The [tfs.computedColumns] section is used to specify additional columns that are computed by the server when updating a work item template. These do not need a value.

Example

[tfs]
host = http://myserver:8080
user = DOMAIN\username  
password = myPassword
regexp = (?is)Work ?Items?: (.+)$
template = Fixed in revision {node|short}.

[tfs.columns]
CodePlex.UpdatedBy = user_cp

[tfs.computedColumns]
CodePlex.UpdatedBy =

Usage

This extension doesn't need user interaction to run.


CategoryExtensionsByOthers

TfsExtension (last edited 2015-07-11 19:33:47 by Sean Farley)