Stephen wrote:
> hey guys, I'm writing a hook for mercurial to auto comment on Trac
> issues mentioned in the commit message.

You may want to have a look at the optional CommitTicketUpdater
component in trunk (in tracopt.ticket.commit_updater) and save yourself
the trouble. All you have to do is set-up commit and changegroup hooks
to call "trac-admin $ENV changeset added" for every changeset.

For example, here's my [hooks] section:

[hooks]
commit = trac-admin /path/to/env changeset added myrepos $HG_NODE
changegroup = hg log -r $HG_NODE: --template "{node} "
  | xargs trac-admin /path/to/env changeset added myrepos

Substitute /path/to/env with the path to your Trac environment, and
myrepos with the name of your repository in Trac. I should really add
this info to the TracMercurial page.

See the following page for more info (SVN-specific, though):

  http://trac.edgewall.org/wiki/0.12/TracRepositoryAdmin#ExplicitSync

and this one for the component:

http://trac.edgewall.org/wiki/TracInstall#AutomaticreferencetotheSVNchangesetsinTractickets

-- Remy

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to