Right now, I have a hook that verifies properties are set on certain
files before I allow a commit. This is pretty close to what you're
talking about "inheritable properties". For example, I have the
following lines in my control-file:
prop: /scripts/.*[^/]$: svn:keywords = /Id/
prop: /scripts/.*[^/]$: svn:eol-style = "LF"
prop: /hooks/.*[^/]$: svn:keywords = /Id/
prop: /hooks/.*[^/]$: svn:eol-style = "LF"
prop: /upgrade10g/.*/$: bugtraq:label = "Mantis Defect ID:"
prop: /upgrade10g/.*/$: bugtraq:url =
"http://10.40.56.99/bug/view.php?id=%BUGID%"
prop: /upgrade10g/.*/$: bugtraq:message = "Fixed Mantis Issue ID: %BUGID%"
prop: /upgrade10g/.*/$: bugtraq:number = /^(yes|true)$/
prop: /upgrade10g/.*/$: bugtraq:warnifnoissue = /^(yes|true)$/
rev: svn:log = /\nMantis Defect Id: (\d+|NONE)$/
prop: .*\.doc$: snv:needs-lock = "*"
The second field (between the colons) is a Perl regular expression.
Then comes the property and it's value. If the value is in quotes, it
is a string. If it is between slashes, it is a regular expression.
According to the above, everything in the scripts directory tree
(except other directories) need to have "svn:eol-style" set to "LF"
and need to have "svn:keywords" contain the string Id in it. The last
one makes sure that all word documents have "svn:needs-lock" set on
them. The ones in the middle make sure that all folders under the
upgrade10g directory tree contain the needed "bugtraq:*" properties
set in order for Mantis and TortoiseSVN to work together. The "rev"
makes sure that the log contains the Mantis defect ID.
Right now, all I can do is reject a commit transaction that doesn't
contain the right properties set. A few weeks ago, I asked this list
about setting properties via a hook during a commit transaction, and
the idea was decidedly panned by most developers. There was a
theoretical argument that data in the source repository shouldn't be
modified without developer control (even if this was just a property).
Plus, that would leave the Subversion client out of whack with what
was on the server.
I've now resigned myself to simply rejecting transactions with wrong
or missing properties set on files and let it be up to the client to
figure out the best way to do their job. They could use wrapper
scripts or set the client autoproperties to do this. It isn't a great
solution, but it is defensible.
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 1 19:34:34 2005