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

Re: Creating a pre-commit hook for copy operations

From: Eric Johnson <eric_at_tibco.com>
Date: Fri, 15 Aug 2014 10:59:22 -0700

I had a similar problem of needing to look for copies. Rather than deal
with the complexity of the API, I simply relied on the "svnlook" command

Specifically, I used "svnlook --transaction ${tx_id} changed --copy-info",
and parsed the result.


On Fri, Aug 15, 2014 at 7:15 AM, Keath Milligan <keath_at_keathmilligan.net>

> We're using Subversion 1.8.3 and need to create a pre-commit hook that
> checks copy operations (specifically branch creation) for certain
> conditions. Specifically, we want to be able to prevent users from creating
> branches in the wrong locations and similar errors.
> To accomplish this, we need to know the source and destination paths of
> the copy operation. Our current pre-commit hook (written in Python) uses a
> delta.Editor subclass to check other things. We tried overriding the
> add_directory method, which has a copyfrom_path argument -- this would have
> been perfect, but this argument is always empty.
> We also tried using the repos.Changecollector and repos.replay2, but this
> doesn't seem to give us information about the pending commit -- perhaps we
> are doing it wrong.
> Any suggestion would be much appreciated.
> Thanks
Received on 2014-08-15 20:00:11 CEST

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

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