You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jon Bendtsen <Jo...@laerdal.dk> on 2005/09/09 15:42:37 UTC

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

Den 9. sep 2005 kl. 17:24 skrev Philip Martin:

> Jon Bendtsen <Jo...@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:

Yeah i know, but i couldnt find any other way to change it before  
committing.


> #!/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)

Why are these language bindings not documented on the web?
At least not in anyplace i have looked. Naturally i look from
     http://subversion.tigris.org/
and i've been looking under
     Documents & files
     the subversion book
     development.

I just cant find it. Maybe if the language bindings was more easily  
found i would not
have used the wrong way to do things. And it's not like it is the  
first time i've been
looking for the language bindings. Back when i made a patch for  
mailer.py i looked
after them as well, but the documentation is gone.



JonB

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Philip Martin <ph...@codematters.co.uk>.
Jon Bendtsen <Jo...@laerdal.dk> writes:

> Den 9. sep 2005 kl. 17:24 skrev Philip Martin:
>
>> #!/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)
>
> Why are these language bindings not documented on the web?

I don't know, perhaps nobody has created any such documentation, I
don't really use the bindings myself.  The bindings are still being
developed and tend to lag behind the C API, you may need to use
Subversion 1.3 for that script to work.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Philip Martin <ph...@codematters.co.uk>.
Jon Bendtsen <Jo...@laerdal.dk> writes:

> Den 9. sep 2005 kl. 17:24 skrev Philip Martin:
>
>> #!/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)
>
> Why are these language bindings not documented on the web?

I don't know, perhaps nobody has created any such documentation, I
don't really use the bindings myself.  The bindings are still being
developed and tend to lag behind the C API, you may need to use
Subversion 1.3 for that script to work.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org