svn copy failing when trying to create branches

China☆狼群 提交于 2020-01-01 09:03:08

问题


I created a repository in my local machine:

svnadmin create /home/me/Desktop/svn_test/trunk

Then import myDir directory to the repository.

svn import myDir/ file://home/me/Desktop/svn_test/trunk

So far svn checkout, commit, update works fine.

Now, I want to create branch from the repository, so I followed the tutorial and executed:

( svn copy source destination )

svn copy file:///home/me/Desktop/svn_test/trunk file:///home/me/Desktop/svn_test/branches

Then I got:

svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///home/me/Desktop/svn_test'

What am I doing wrong here?

After carefully examine the sample command, I found out there are backslashes like below, what are those? (and still get error)

svn copy file:///home/me/Desktop/svn_test/trunk \ file:///home/me/Desktop/svn_test/branches \ -m "test"
svn: Cannot mix repository and working copy sources

回答1:


You didn't create a repository in svn_test

You created it in svn_test/trunk

You want

$ svnadmin create /home/me/Desktop/svn_test

instead.

The way you did it, svn_test/trunk is the repo, so subversion can't do anthying about svn_test/branches -- since that is not a repository path.

EDIT (for clarity):

What you want to do is something like this:

$ mkdir /path/to/repo               # NO /trunk!
$ svnadmin create /path/to/repo     # NO /trunk!
$ svn import -m "initial import" . file:///path/to/repo/trunk    #import into a directory called "/trunk" that lives in the repository
$ svn co file:///path/to/repo/trunk myproject
$ cd myproject
$ # do some stuff to your working copy...
$ svn commit -m "I made some changes"
$ # decide you want to make a branch...
$ svn copy -m "branching for some reason" file:///path/to/repo/trunk file:///path/to/repo/branches/some-branch

Note that there is no mention of "trunk" until the svn import happens.



来源:https://stackoverflow.com/questions/3517275/svn-copy-failing-when-trying-to-create-branches

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