[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Switching Branches

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-06-24 14:54:59 CEST

On Thu, 2004-06-24 at 05:01, Mads Budde wrote:
> Hi,
>
> I have two branches (a and b), when I do a checkout of 'a' (svn co
> https:\\host\path\branches\a from c:\sandbox\) I get the following
> structure:
>
> c:\sandbox\a\... (Containing branch a)
>
> Now I do a switch to 'b' (svn switch -rX:Y https:\\host\path\branches\b).
> This I have to do in the directory a, as above it there is no svn
> information. After doing this i have:
>
> c:\sandbox\a\... (Containing branch b)
>
> My questions are:
> 1. What is the reason for initially creating the directory and not just
> checking out the contents into my sandbox directly?

Because a 'switch' is just a fancy type of update. Unlike the checkout
command, which creates a new sandbox, the update and switch commands
"transform" an existing sandbox to represent a different location and/or
time.

> 2. This is rather confusing having branch 'b' under directory called 'a',
> how do other people deal with this? Some developer might forget this and
> check in stuff into 'b' that should have gone into 'a'.

So don't do it, then!

Most people don't name their sandbox 'a'. They name it after the
project itself. There's no way to know if a sandbox named 'project'
actually represents the trunk of the project, or some specific branch.
You just happened to create a confusing example.

For example, I typically work on subversion by running

  svn checkout http://svn.collab.net/repos/svn/trunk svn

Then I get a sandbox named 'svn'.

If somebody reports a bug on a branch, then I run

  svn switch http://svn.collab.net/repos/svn/branches/branch1 svn

And my sandbox 'svn' is updated to reflect the branch instead of the
trunk.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 24 14:57:29 2004

This is an archived mail posted to the Subversion Users mailing list.