开发者

Moving source files to a new project.. how to keep alive the SVN history of older committed versions in new project

开发者 https://www.devze.com 2023-04-09 04:10 出处:网络
I am moving source files from a web app project in ne开发者_如何学编程tbeans to a new maven web app project in netbeans. Since my project was under the subversion repositories I need to merge my new c

I am moving source files from a web app project in ne开发者_如何学编程tbeans to a new maven web app project in netbeans. Since my project was under the subversion repositories I need to merge my new created project with the committed versions of old project in the repository so as to keep the history still alive. How do I merge the two projects in subversion repository


I infer from your question that your old project (let's call this project A) is under source control and your new project (project B) is not. If that is indeed the case, you have a couple options.


As you suggest in your follow-up comment, import B as a subtree of A. By definition then you have achieved your goal of maintaining the history of A (because you have not changed A). Note that there are two principal ways to do this import: the one-shot import and the import-in-place. You can read details about both in the Tortoise manual here but you can start with this table I put together to illustrate the differences:

Moving source files to a new project.. how to keep alive the SVN history of older committed versions in new project

In a nutshell, the one-shot import (done via SVN >> Import) sounds like a time saver but in reality it takes the same number of steps as the import-in-place (done via SVN >> Add) and the latter is both more flexible (due to item 2 in the table) and more to the task (items 3, 4, and 5).


Another possibility implied by your question is that you want to start a new project in the repository for B (done via the same import choices as above) and you then want to move the tree for A underneath B. This is a simple drag-and-drop operation in Windows Explorer. But use the right-mouse button to drag so that you get a context menu when you release the mouse button over your target. Then select the SVN Move versioned item(s) here choice. This action actually spawns both a delete action and an add action, as you will see if you then open the commit dialog on a parent common to both source and target directories. Subversion retains knowledge of the move implicitly, though: after you commit view the log from the new location and uncheck the box at the bottom labeled stop on copy/rename you will see the complete history.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号