On Tue, Oct 15, 2002 at 12:27:23AM +0200, Branko Cibej wrote:
> Noel Yap wrote:
> >I have a few questions about post-commit hooks:
> >1. How can I get/set properties from within a hook?
> >Will "svn propset" and "svn propget" eventually be
> >generalized to work on URL's?
>
> I don't think we have any plans for that, but patches are always
> welcome. :-) But be aware that changing a file or dir property requires
> a commit.
If the properties are *revision* properties, then a URL can be used. But as
Branko notes: file/dir property changes will require (another) commit.
Typically, I would think that the hooks will be using 'svnlook' or the
repository/FS libraries (or indirectly via bindings) to do their work,
rather than cycling back through the Apache interface (well, they could also
use ra_local).
> >2. Does the post-commit hook occur inside or outside
> >the original transaction? If it occurs inside, will
> >it deadlock if I try to perform another commit
> >(assuming I take care of infinite loop scenarios)
> >inside the post-commit script?
>
> The hook itself is run synchronously. Because of that, the hooks I use
> all fork off the real work to another process and return immediately,
> because the client is blocked during hook execution, which could lead to
> timeouts.
Right. However, I think Noel was also asking whether the post-commit occurs
within the SVN FS transaction. And the answer is "no". The FS has already
committed the transaction and generated a revision number. That is why it is
called "post commit".
> >3. Is there a way to differentiate between a branch
> >and a tag (so that the post-commit hook can treat them
> >differently)? Will there be one in the future?
>
> Now, you know that's a stupid question, don't you? :-) How can
> Subversion tell the difference between tags and branches, when it
> doesn't even enforce a repository layout?
Yah, what Branko said.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 15 00:38:38 2002