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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With