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

Re: Programming a Watcher File

From: David Weintraub <qazwart_at_gmail.com>
Date: Wed, 3 Mar 2010 12:00:45 -0500

On Tue, Mar 2, 2010 at 11:39 PM, Andrey Repin <anrdaemon_at_freemail.ru> wrote:
> Sorry, my head is a bit crippled for now, and your post contains too much
> cross-references to be understandable in my current state.
> Could you please put it in simple terms, how you see your potential system
> works?

We have both development teams in India and in New York. When the
Indian development team makes changes, the New York QA team needs to
be notified, so they know what to test. When the New York development
team checks something in, the Indian QA team needs to be notified.
This will currently be for a single project, so I have to specify
those files in that project that need to be watched.

I decided to make this hook script a bit more general than for this
specific circumstance. What if there are separate teams for each
branch that need to be notified? What if other teams want their files
to be watched?

> If having a custom (and client-customizable) configuration is all you ever
> want, there's a hint: hook script can access repository as easy as any other
> local file. Just do "svn cat" on required file and parse it's content as
> normal.
>
> However, be very wary of access rights on the mentioned configuration file.

I am using "svnlook cat" which is a bit faster since I don't have to
go through the Subversion server. I will be setting the rights on this
configuration file, so only the managers can modify it. Plus, I'll get
an email whenever the configuration file itself gets modified.

Originally, I was thinking about using properties to set the watch. If
I want a particular directory tree watched, I could put a sol:watch
property on that directory, and anytime a file in that directory tree
gets modified, I'll email the users.

However, how do you find all of these properties? If I check in a file
svn://host/project/dir/dir2/dir3/file, I'd have to check all the
parent directories for the property (that's five different directories
to check, plus the file itself). And, I'd have to do that for each
file changed. Plus, how do developers find all of their watches?
Therefore, I decided it would be better to have a single configuration
file for the watches.

Another possibility is to have a directory where users can put their
own watch definitions. I have an access control script that can easily
be setup so that barry.cfg can only be changed by barry and david.cfg
can only be changed by david. But, that means getting a list of these
watch files (svnlook tree), and then checking opening up each one to
construct my watch list. That might take too long.

-- 
David Weintraub
qazwart_at_gmail.com
Received on 2010-03-03 18:01:20 CET

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