How to distinguish between regular commit and merge in Subversion?

I am working on intercepting an SVN repository. Here is a typical repository structure:

trunk/ branches/ branch1/ branch2/ 

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

I found that merging changes the svn: mergeinfo 'property of the destination directory. So, I need to analyze the commit changeset, determine the change to the dir property, and check if the svn: mergeinfo property has changed since the last commit.

It all seems too complicated. Is there a more convenient way to detect merging?

+4
source share
1 answer

It seems to me that detecting a change in the svn: mergeinfo property is the only way to distinguish it. Of course, you must also make sure that your commits do not come from clients prior to version 1.5, which do not create mergeinfo.

+2
source

Source: https://habr.com/ru/post/1313494/


All Articles