You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jackie Xiao <ja...@ebaotech.com> on 2016/03/03 07:50:13 UTC

how to decide whether a commit is a merge in pre-commit hook

Dear list:

I'm writing a svn pre-commit hook, and I want to quit further rule checkings if the commit is a merge operation.

I have searched online, it seems there are no way to distinguish normal commit from merge commit.

My current way for handling this is very clumsy, get the changed list from "svnlook changed", then iterate through every changed item to see if the line starts with _U (property changed)...

Any suggestions? Thanks in advance

Thanks
Best Regards

This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and may contain confidential and/or privileged material. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication, or dissemination in any form) by persons other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.

Re: how to decide whether a commit is a merge in pre-commit hook

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 3, 2016, at 12:50 AM, Jackie Xiao wrote:
 
> I’m writing a svn pre-commit hook, and I want to quit further rule checkings if the commit is a merge operation.
>  
> I have searched online, it seems there are no way to distinguish normal commit from merge commit.
>  
> My current way for handling this is very clumsy, get the changed list from “svnlook changed”, then iterate through every changed item to see if the line starts with _U (property changed)…

Could you instead check for the presence of the svn:mergeinfo property?