SVN - automate merge of trunk into branch

倖福魔咒の 提交于 2019-12-03 09:32:29

问题


I have a branch in SVN that I want to keep up to date with changes from the trunk. What I would like to do is have a script or something that runs nightly that does this merge and then commits the new version of the branch if there are no merge conflicts but if there are merge conflicts somehow indicate so. I found this post that is somewhat helpful although it doesn't do everything.

I have been unable to find a way to determine whether there are merge conflicts and this is mostly what I'm looking for. Adding building the code and then committing on success will be easy enough in the script but without having a way to check for merge conflicts this won't be successful.

Thanks for any help you guys can provide!


回答1:


I had your same exact problem, though I didn't try to automate merge because there were not many branches and I did it manually.

Anyway, the best option looks like using scripts. The script linked in your post doesn't do only the last required action: commit

I often use Linux so, if I was you, I would have used a shell script like the following:

cd /path/to/branch
svn update #just to be sure...
svn merge --non-interactive svn://path/to/trunk
svn commit -m "Automated commit"

A similar command could be used with SVN for windows in a batch script




回答2:


Have a look at MergeFairy. It will continuously merge and email you on conflicts with instructions on how to resume.



来源:https://stackoverflow.com/questions/4547142/svn-automate-merge-of-trunk-into-branch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!