Tortoise SVN Merge “@### must be ancestrally related to @###” Error

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 06:26:33

问题


Backstory: Got a job as an entry level web developer. Head developer leaves right when I start. All responsibility on me. Never used SVN. Going in blind.

Problem:
I keep getting errors like

'svn://svn/svn/xxx/project_name/branches/dev@330' must be
ancestrally related to 'svn://svn/svn/xxx/project_name/trunk@326'

The process by which I am starting the new project is:

  1. Make a directory for the project on my computer with subfolders:
    project_name/branches
    project_name/branches/dev
    project_name/tags
    project_name/trunk

  2. Right click the project root, select my project root, and Add it to the repository

    (All that follows are what I have to do for current projects, and this works no problem in them, but breaks for new projects at the merge)

  3. Commit "dev" branch

  4. Merge "dev" into "trunk" (Merge all revisions) * BREAKS HERE *
  5. Commit "trunk"
  6. svn up, etc

Not being familiar with SVN, I am having a really tough time with this. As I said, doing 3-6 on existing projects works, but on new ones, I get the must be ancestrally related to error on merge. So, what am I doing wrong? All and any help is greatly appreciated.


回答1:


[thatidiotguy][1] is probably right about not creating via a copy from trunk.

If you use svn log --verbose --stop-on-copy on the dev branch, the earliest entry should show where you copied the branch from.

TortoiseSVN's svn log function works the same way; stop on copy is a checkbox in the log window.

If you didn't create it from a copy, then it can't be merged back.

You'd need to recreate the dev branch and reapply your changes.

Update: By "recreate the dev branch", I mean make a new branch for development, which is an actual svn copy (branch) off of the trunk. If you create the branch using svn copy trunk/[application subfolder] branch/[application subfolder - name of branch], svn will record the original source version. This permits intelligent merging of changes in the trunk/base version into the branch (to fix defects, add features, etc.) Once the copy is made, you can copy over the changed files from the original source, and commit them as normal changes to the code.

How to replace a branch in subversion?

https://stackoverflow.com/users/821722/thatidiotguy



来源:https://stackoverflow.com/questions/22204268/tortoise-svn-merge-must-be-ancestrally-related-to-error

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