[keeping this on the dev list]...
"Richard In Public" <edification@blueyonder.co.uk> writes:
> Thanks for this very helpful reply. How confused I have been! I have been
> assuming that the repository on the server side contained a directory
> structure similar to a working copy. Pretty silly now that I get it, but I
> was so focused on the idea that SVN directories are just directories (aha,
> client-side only) that I failed to grasp this.
No problem. :-)
> in the Definitve Guide, (p. 41) the Create Branch example
> reads:
>
> $ svn copy http://svn.example.com/repos/trunk/calc \
> http://svn.example.com/repos/branches/calc/my-calc-branch \ -m "Creating a
> private branch of /trunk/calc"
>
> Accordingly, I tried the following
>
> C:\> svn copy http://localhost/svn/repos/trunk
> http://localhost/svn/branches/mybranch - m "Create branch"
> This works, but I get ..... branches/mybranch/trunk/...
>
> I'm using a repository per project, so my 'trunk' directory directly
> contains project files. Is this a bad practice, or is there a way to do
> copy the contents of 'trunk' directory to a branch directory without copying
> the trunk directory itself as well.
Sure. 'svn cp' has the same semantics as Unix cp.
If /branches/mybranch already exists, then
cp /trunk /branches/mybranch
will create a directory 'trunk' within in /branches/mybranch.
But if /branches/mybranch doesn't exist, just /branches, then the same
command will create a new directory 'mybranch' which is a clone of
'trunk'.
This is how we create branches all the time in Subversion's own
repository:
'svn cp http://svn.collab.net/repos/svn/trunk \
http://svn.collab.net/repos/svn/branches/newbranch'
> Richard
> P.S. The strange error message was svn prompting me for a message, in the
> absence of -m "...".
Just like CVS, you have to supply a log message when committing to the
repository. If you don't pass -m or -F, then it pops up
$[SVN_]EDITOR.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 20 16:44:27 2003