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

Re: revprop changes and hooks

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 08 Jun 2010 19:03:13 +0100

"C. Michael Pilato" <cmpilato_at_collab.net> writes:

> Philip Martin wrote:
>> Revision properties are unversioned that's well documented. There are
>> two hooks associated with a revprop change, the pre-revprop-change and
>> the post-revprop-change. What's not well documented is that these
>> hooks and the change are not executed within a Subversion transaction,
>> which means that the ACTION parameter passed to the hooks is not
>> reliable.
> By "reliable", are you talking about a race condition that can be triggered
> by multiple clients trying to modify the same revision's properties or
> something? Do you have an example that explains your concern?

Multiple clients. It arises from my idea to solve issue 3546


In svn_repos_fs_change_rev_prop3 the code first gets the old property
value which it uses to calculate the action: 'A', 'M' or 'D'. Then it
passes the action to the pre-revprop-change hook, then it changes the
property and finally it runs the post-revprop-change hook. Some other
process can change the revprop at any time so although the
pre-revprop-change hook might get passed an 'A' say, when the change
is made it could be effectively an 'M'. The action passed to the hook
is not a reliable indication of the change to be made.

Putting the get, pre hook and set into a transaction would allow the
action in the hook to accurately reflect the change made (or not made
if the transaction fails).

Received on 2010-06-08 20:03:55 CEST

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