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

Possible to emulate dir locks using svn pset and pre-commit hook?

From: Tommy Knowlton <Tommy_at_KE4KUG.net>
Date: 2007-02-22 20:35:23 CET

I already wonder whether I might be better posting this to the
developers' list, but I'll try here first...

I'm trying to implement the semantic equivalent of directory locking.
When a dev team decides that a branch is ready to be released, they
(currently) lock all of the files in the branch and build/deploy the
artifact from those sources. Further development (for the next release
version they're working toward) goes on a new branch copied from the
released branch.

The point of locking is to ensure that nobody should be able to
accidentally change the branch after it's been released. For example,
if someone missed the announcement of the release, and still has a
working copy of the (now released) branch. Or, if they just forget to
switch their wc. Of course, with file-only locking, there's still
plenty of damage that could be done accidentally (adding files and
directories).

I intend to implement a pre-commit hook (already in the works,
actually) that enforces the following two conditions:

1) reject commit attempts in repository trees where any containing
directory, recursively up to the repository root, has a specified
property (let's call it my:locked).

2) reject commit attempts that attempt to set the my:locked property
if any child node has an svn:externals property set.

The second condition is necessary because we want to force devs to
change all their svn:externals to "real copies" in the source control
before they lock-for-release. The point is that once
locked-for-release, the sources in that branch are "forever" frozen.

I'm writing to the list today to ask for expert advice. There are
obviously reasons why Subversion does not implement directory locking
(and I've read and understand some of those, since searching for ideas
to solve this problem), but I wonder whether my requirement is
sufficiently specialized to enable an easy solution. Are there more
concerns that my pre-commit hook should look for? Of course, I'll have
to address the need (it might happen, I realize) to "unlock", but I
think for now I'll leave it as a thing that requires repository admin
intervention.

Thanks for your time thinking about this with me.

--
Tommy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 22 20:35:49 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.