[svk-devel] Using hook scripts to prevent non-SVM commits to mirrored paths

David Glasser glasser at mit.edu
Tue Aug 8 10:30:14 EDT 2006


So, you aren't supposed to commit to mirrored paths with tools that
don't use SVN::Mirror.

Hook scripts (like pre-commit) can cancel commits by using svnlook to
examine the transaction.

We do some distinctive things when we commit, and we can make
ourselves more distinctive.

For example, I think that most of the time we're setting an
svm:headrev transaction property when we commit to mirrored paths, so
I'd think that

$SVNLOOK pg --revprop -t "$TXN" "$REPOS" svm:headrev

might tell us something useful, but it doesn't seem to. hmm.

In any case, we should be able to write a little perl script that (a)
yoinks svm:mirror from // (b) succeeds if it's not a mirrored path (b)
checks the transaction properties for svm:headrev and succeeds if it's
there (c) fails otherwise

Anyone want to give it a shot?

--dave

-- 
David Glasser | glasser at mit.edu | http://www.davidglasser.net/


More information about the svk-devel mailing list