tags:

views:

24

answers:

1

I created 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
+3  A: 

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.

timdev
I've updated the question, sorry it was typo so I actually created repository in /home/me/Desktop/svn_test/trunk
masato-san
Ignore the backslashes you saw -- they're for making multi-line commands in shell. Your problem is still that "trunk" is not supposed to be the repository, just a directory that is *in* the repository. Editing my answer to give a proper demo.
timdev
Great! it's working now, thank you! I confused the use of trunk between my project dir and repository.
masato-san