Creating branch in AnkhSVN adds entire repository to branch instead of single project

瘦欲@ 提交于 2019-12-23 04:09:19

问题


I have a single Subversion repository containing all my Visual Studio projects. The repository is organized as follows:

repository/
    branches/
        project1_branch/
        ...
    tags/
        project1_tag/
        ...
    trunk/
        project1/
        project2/
        ...

When I right-click on a particular solution I have open in Visual Studio 2010 and choose Subversion --> Branch Solution the default From Folder/URL is the trunk directory.

How can I create a branch of just the specific solution/project I am working on?

Thanks in advance for your help.


回答1:


I wonder if AnkhSVN is assuming a slightly different repository folder structure. If I'm not mistaken, the "recommended" structure suggests that a trunk folder represent a given project's stable/current code base, rather than as a folder that aggregates multiple project's trunks. That is, I would expect to see a structure more like:

repository/    
    project1/
        branches/
        tags/
        trunk/
    project2/
        branches/
        tags/
        trunk/

If you look at it from that perspective, the AnkhSVN behavior of branching from trunk makes a bit more sense - it just sees the subdirectories as part of the structure rooted at "trunk," but doesn't know or expect those are discrete projects' trunks.

I would respectfully suggest building a top-level project folder from the repository root for a "test" project, organized as illustrated above, then exercise it through AnkhSVN, and see if perhaps a going-forward change to your repository structure might serve you best over the long term.




回答2:


AnkhSVN tries to guess in what place of the tree your project is rooted. In most cases this is the root of your working copy. (You didn't check out at the working copy root, didn't you?).

If you checkout ^/trunk (where ^ = your repository root), AnkhSVN will suggest merging that to ^/branches/something. (Checking out at a different level can be very expensive and breaks the Subversion pattern where branching is cheap. When you update you would create all 'cheap' copies on your local machine)

If you want AnkhSVN to branch at a different level, you can set the project root via "File->Subversion->Change Source control". And then select the option on your solution.



来源:https://stackoverflow.com/questions/8419114/creating-branch-in-ankhsvn-adds-entire-repository-to-branch-instead-of-single-pr

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