[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [hook-script] new pre-commit script to add bugzilla urls to log messages

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-09-09 17:24:09 CEST

Jon Bendtsen <Jon.Bendtsen@laerdal.dk> writes:

> I have made a pre-commit hook script that adds bugzilla urls to log
> messages.
> It is a bash shell script, and it uses cut, sed, grep, echo, ...
> It works on my debian stable using subversion 1.2.0-1 from testing?
>
> This script CHANGES the props file in the transaction directory.

Eeek! Modifying the database files directly is not recommended. It
would be better to use the language bindings:

#!/usr/bin/python
import sys
sys.path.append('/usr/local/subversion/lib/svn-python')
from svn import repos, fs
repos_handle = repos.open(sys.argv[1])
fs_handle = repos.fs(repos_handle)
txn_handle = fs.open_txn(fs_handle, sys.argv[2])
log_msg = fs.txn_proplist(txn_handle)['svn:log']
log_msg = log_msg + ' modified' # do the fancy bug URL stuff here
fs.change_txn_prop(txn_handle, 'svn:log', log_msg)

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 9 17:27:51 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.