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

Maintaining a list of files that have this one property

From: Dave_Thomas mailing lists <davelist_at_peoplemerge.com>
Date: 2006-06-09 04:19:01 CEST

Hi all,

I'm new to the subversion mailing list, sorry in advance if this belongs on
the developer list.

I have a constraint on subversion that files across the repository
containing a certain property must have unique names (this is a business
rule for our app... don't ask).

For example, suppose Trunk/src/foo.txt has the property must-be-unique=*. I
have a hook in place that will prevents Trunk/conf/foo.txt having the same
property from being committed.

The problem? The hook now makes this call:
pysvn.Client().ls(reposurl, recurse = True)
then traverses to find its friends.

Our repository is soon to grow to 20k files, and that call alone will take

I couldn't find another function that implemented something like UNIX 'find'
checking properties as well.

The best solution I can come up with is to maintain a list of all files with
that property already but I have concerned questions about how to do this in
a hook.

Here's the idea. On every commit transaction, I would read in a flatfile
list, or better yet, a pickle containing an array. Then, if I need to add
an entry, I would somehow add the pickle to the transaction (so changing it
is atomic), and reserialize it.

Would I need to be creating a subtransaction (does that exist)? Or is this
something as easy as attaching a couple of lines of DIFF to the
transaction? (I feel like a homeless guy holding a sign "any spare
code appreciated. God bless")

Here's an alternative but I think you're going to say this is a bad
idea. Doesn't subversion use a database internally? Isn't it
transactional? I could keep a table with all files with this property. Or
maybe manage an index on this property or create a view on the
database? Will I be able to do this within a hook or do I need to go deep
into the subversion API to support this kind of thing?

Your thoughts on the most elegant solution would be appreciated!
Dave Thomas
Received on Fri Jun 9 04:20:25 2006

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.