简体   繁体   中英

SVN Pre Commit check

We have two branches A and B with the same source code structure

Any check in that happens in B , need to happen in A as well.

For example : There is a file Employee.java in branch A and branch B in the below folder project/src/main/java/com/mycomp/Employee.java

While checking in the file Employee.java to branch B , I need to check if the same file is already checked into branch A by comparing the contents of Employee.java in both the branches . If not , I should not allow the developer to commit

Is it possible to implement such logic in SVN pre commit hook and fail the commit ? Is there any out of the box solution from SVN to implement such checks ?

Well, while I find the use case rather strange, it can be achieved with SVN pre commit hooks (some scripting required).

Here is a decent write up of how to create and use pre commit hooks:

http://wordaligned.org/articles/a-subversion-pre-commit-hook

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM