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

Re: read hooks

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-04-20 01:48:35 CEST

On Apr 19, 2007, at 13:09, Will Norris wrote:

> Subversion has a number of hooks that are called when data is being
> modified, but I'm curious if there is any way to create a hook that
> is called when data is simply being read.

Subversion has the following server-side hooks available:

post-commit
post-lock
post-revprop-change
post-unlock
pre-commit
pre-lock
pre-revprop-change
pre-unlock
start-commit

It's pretty clear from the names at what times these hooks are
executed. The pre-lock hook, for example, is run before a user-
requested lock operation completes. post-commit is run after a commit
completes. The pre-* and start-* hooks have the ability to prevent
the operation from taking place; the post-* hooks can simply take
actions after they have taken place.

Subversion does not provide hooks for the actions checkout, update or
export, but if you serve your repository with Apache, you can use a
script of mine to additionally implement the following hooks:

post-checkout-or-export
post-update

The script is here:

http://www.ryandesign.com/svnhookdispatcher/

> My specific use case is that of student privacy here at USC; US law
> states that a student can request the university not release any of
> their personal data. So for those students, I'd need to be able to
> mask the svn "author" attribute in some way. My first inclination
> was to write hook that intercepts a read request and masks the
> <D:creator-displayname /> for those students who have requested
> this confidentiality. Is that type of hooking available, or would
> I need to dig into the subversion source? Or is there some other
> way to achieve this perhaps that I'm not thinking of?

No, I don't think there's any provision for that kind of hooking
within Subversion. But if you're serving with Apache, since
mod_dav_svn is just sending XML data to the client, maybe there is a
way to use an XML post-processor to modify the Subversion output
before it goes to the client. But this is beyond my area of expertise.

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Apr 20 01:49:07 2007

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

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