On 10 Aug 2005 16:11:15 -0500, kfogel@collab.net <kfogel@collab.net>
wrote:> Not quite. > From the pre-commit hook, you can set (or modify
or
> delete) a revprop on the txn, before that txn becomes a finalized
> revision.
Can you explain how that's done? I've been trying to do just that for a while.
The "svn prop(get|del|list) -revprop" commands require the "-r"
parameter for the revision. The "svn commit" command doesn't take any
revprop arguments, so it can't set them. In a hook script, you can use
the "svnlook proplist" and "svnlook propget" commands, but they can
only look at a property value, but not set it. You simply can't set
any type of properties via the svnlook command. Even worse, if you use
"svnlook propslist -revprop -t $TXN" to see what a particular revision
property is set to, you'll get an error as it reports that the
transaction number is an invalid "revision".
I have a hook script where I do try to set, or at least examine
revision properties, but no such luck. I even had to write in a kludge
to get it to work with svn:log.
Yes, when you do a commit transaction, you do set three revision
properties: svn:date, svn:author, and svn:log, but you have no control
over two of them, and the third you enter as the -m parameter of the
commit command.
There is really no mechanism in Subversion to set these properties. I
looked into modifying the svn propset command to set revision
properties on the next commit (much like you can set non-revision
properties on the next commit). The issue started to become more and
more complex the closer I looked. For example, where would you store
the revprops?
Non-revision properties are stored in the .svn directory under the
directory where the file is kept, but since revision properties aren't
associated with a file, you can't do that. When you create a
Subversion working directory tree, every directory has it's own .svn
directory, and each one is capable to do a commit. In which one of
these directories would you store the revision properties? What would
happen if you don't do your commit from that directory?
I also looked into what it would take to set revision properties in
the commit transaction, but realized that the infrastructure wasn't
really there. The three revprops that are set are treated as special
cases and not in a generic way.
There is a defect
<http://subversion.tigris.org/issues/show_bug.cgi?id=1976> currently
on this issue.
Now, you can set revision properties in a POST-commit hook via the
"svn propset --revprop -r $REVISION" command.
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 11 02:28:39 2005