Peter McNab wrote:
> After getting TortoiseSVN to create a branch I get the popup note
> going on about using the Switch command in relation to "the working
> copy". Now I consider I have a more than one working copy (WC) for a
That warning is there because some people might think that after
creating a branch, their working copy is automatically changed to be
based on that branch. That is not the case - the WC is unchanged by a
> If I use TortoiseSVN to "switch" working copies say from trunk to a
> new branch, as suggested, what exactly happens to the files on my
> local machine and are there any followup commands necessary to
You should read the SVN book, which describes the difference between
Update and Switch. Sorry, don't remember the chapter reference. Often
there are only minor differences between two branches. When you create a
branch, most of it is a cheap copy from somewhere else (often the
trunk), so if your WC is currently reflecting the repository trunk and
you want it to reflect a branch, it will not require many changes. And
that is exactly where Switch helps you. You could do a fresh Checkout
from the branch, but it saves a great deal of bandwidth to use Switch to
modify your WC so that it is based on the branch instead of the trunk.
All it has to do is update the files which are different. It will also
delete (version controlled) files in your WC which were in the old
branch but not the new, and it will add files which are in the new
branch but not the old. Unversioned files wil not be touched of course.
> complete the operation such as "Update" or "Commit"?
> If so why not have these incorporated automatically by TortoiseSVN?
Nothing else is needed. Switch is a generalised version of Update.
However, _before_ you switch you should commit (or revert) any pending
changes. If you don't then when you switch, your local changes will be
merged into the same files on the branch you switched to, effectively
porting changes you are making on trunk into the branch. That is
probably not what you intended.
> If there is more than one active branch, on a local machine does one
> have to "Switch" from one branch to the other and back again to make
> and commit changes?
That's up to you. You can have one WC and use Switch to move it between
the different branches and trunk. Or you can have a separate WC for
each. One useful tip if you want separate WCs: rather than do a fresh
checkout of the branch over a low bandwidth connection, you can make a
copy of your existing trunk WC, then use Switch to change it to point at
> Having "Switched" a working copy, is there some state or property that
> can be examined to see which is the current working copy?
Your terminology is confused here. You can have any number of working
copies on your local machine. They can point to different branches
within the repository (or they can all point to the same place, but that
is not so useful). In TSVN you can check which branch your WC is based
on by looking at the Windows properties of a folder. On the Subversion
tab you will see the repository location.
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.tigris.org
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Mon Jan 17 12:06:40 2005