tags:

views:

55

answers:

1

I'm working on SVN repository hooks. Here is the typical structure of repository:

trunk/
branches/
    branch1/
    branch2/

In pre-commit hook I need to detect if merge (between branches, from branch to trunk or vice-versa) has been performed and check if user is authorized to perform merge.

I discovered that merge changes 'svn:mergeinfo' property of destination directory. So, I have to parse commit changeset, detect dir's property change and check if 'svn:mergeinfo' property has changed since the last commit.

All this seems too complicated. Is there more convenient way to detect merge?

+1  A: 

Seems to me that detecting a change in the svn:mergeinfo property is about the only way to distinguish it. Of course, you have to also ensure your commits are not coming from pre- v1.5 clients which don't create mergeinfo.

PilotBob