SVN: how to merge tags from separate projects

拜拜、爱过 提交于 2019-12-24 11:33:56

问题


I have a single SVN repository with two separate projects:

project_1
    /trunk
    /branches
        /1.0
    /tags
        /1.0.0

project_2
    /trunk
    /branches
        /1.0
    /tags
        /1.0.0

As you can see, each has identical branch/tag numbers. Imagine there are different files in each project.

I want to merge these into a single new project, project_3. That is, the trunk of the new project will have all files/histories from the trunk of project_1 and project_2, the 1.0 branch will have all files/histories from the 1.0 branches of project_1 and project_2, and the 1.0.0 tag will have all files/histories from the 1.0.0 tags of project_1 and project_2.

My first thought was to do accomplish this using multiple svn cp executions. A big problem I ran into was not being able to copy just the subdirectories of a directory to another directory. I am having trouble understanding whether the solutions discussed in that post apply to the situation here. Also, the post and many of the solutions are six years old and I wonder whether there have been any change to SVN that would help here.

The goal is to have a single unified project with as much history preserved as possible. What is the best approach to take here? Please note that switching to another VCS is not an option.


回答1:


If you want to merge data and history, you can't use SVN copy" you must to use dump|load cycles:

svnrdump sump URL/OF/DIR ... > dump + svnadmin load --ignore-uuid --parent-dir NEW_PARENT ... < dump

Instead of svnrdump you can try svnadmin dump | svndumpfilter



来源:https://stackoverflow.com/questions/23524961/svn-how-to-merge-tags-from-separate-projects

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