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:
Make a directory for the project on my computer with subfolders:
project_name/branches
project_name/branches/dev
project_name/tags
project_name/trunk
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)
Commit
"dev" branchMerge
"dev" into "trunk" (Merge all revisions) * BREAKS HERE *Commit
"trunk"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.
[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.
来源:https://stackoverflow.com/questions/22204268/tortoise-svn-merge-must-be-ancestrally-related-to-error