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

revprop changes and hooks

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 08 Jun 2010 11:35:21 +0100

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. The example pre-revprop-change hook created with every
repository includes:

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi

which could lead one to believe that ACTION is reliable.

At the very least that's a documentation bug, but is it a code bug as
well? Is there any point in providing ACTION if it is not reliable?
Should we run the pre-revprop-change and the change itself in a
Subversion transaction? Something like:

    Process 1 Process 2
    --------- ---------
    start txn
    get old value
    run pre-revprop-change
                               start txn
                               get old value
                               run pre-revprop-change
    change-value
    commit txn
    run post-revprop-change
                               change value
                               fail to commit txn
                               return error
    return success
  

-- 
Philip
Received on 2010-06-08 12:36:04 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.