Small Gotcha When Copying Paths With Subversion

I was trying to do an svn copy from a specific server path into a local working copy. I basically wanted to copy over the vanilla mediawiki-1.8.1 sources from my repository into a local directory (called trunk). Here is what I did:

svn copy svn+<a href="ssh://david@server/svn/repos/Projects/wiki/mediawiki/1.8.1">ssh://david@server/svn/repos/Projects/wiki/mediawiki/1.8.1</a> ./trunk

You would think that this would copy the contents of the 1.8.1 directory into the trunk directory. Wrong; it copies the 1.8.1 directory and its contents into the trunk directory, thus creating a 1.8.1 directory inside trunk. It took me forever to figure out why it was doing this instead of what I wanted it to do (which is to copy the contents of 1.8.1, not the 1.8.1 directory itself).

The problem was that the trunk directory already existed. If I removed the trunk directory, then it creates the trunk directory and copies the contents of the 1.8.1 directory into trunk.

In case anyone is curious, what I am doing is following the instructions from the svn book on how to maintain vendor branches.

Add new comment