"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
http://subversion.tigris.org/issues/show_bug.cgi?id=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).
--
Philip
Received on 2010-06-08 20:03:55 CEST