You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Karl Auer <ka...@biplane.com.au> on 2006/01/04 11:11:04 UTC
(Silly?) question regarding branch and switch
Hi there.
I'm trying to get a grip on branches.
When I use Subclipse to create a branch, then switch to that branch, I see appropriate log messages (probably broken by my mailer):
copy -rHEAD svn://localhost/repository/svntest/trunk svn://localhost/repository/svntest/branches tb1
Committed revision 7.
switch svn://localhost/repository/svntest/branches/tb1 /home/kauer/eclipse_workspace/svntest -rHEAD
At revision 7.
In the project browser, however, the project still shows up as "svntest [svntest/trunk]". I was expecting it to change to "svntest [svntest/branches/tb1]".
When I then make a change to a file in the project and commit the change, the change appears to have been made in *both* copies, trunk and branch. When I use switch, it *seems* to switch (see the log entries above), but the version of the file I get is always the changed one, and the label decoration never changes from "[svntest/trunk]". The default URL in the "Switch to Branch/Tag" dialog is always the trunk, as if it never switched away.
Am I fundamentally misunderstanding what switch is supposed to do?
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@biplane.com.au) +61-2-64957160 (w/h)
http://www.biplane.com.au/~kauer/ +61-428-957160 (mob)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: (Silly?) question regarding branch and switch
Posted by Joshua Varner <jl...@gmail.com>.
On 1/4/06, Karl Auer <ka...@biplane.com.au> wrote:
> On Wed, 4 Jan 2006 14:33:57 -0600, Joshua Varner <jl...@gmail.com> wrote:
> > > I'm trying to get a grip on branches.
> > [...]> You might try one of these lists:
> > http://subclipse.tigris.org/servlets/ProjectMailingListList
>
> Thanks Josh. Yes I might, but I figured the Subversion users list was a better place to ask "what exactly is switch supposed to do".
>
> As I read the SVN book, it is supposed to make your working copy look like a specified revision. It is described as a variant of update. When I make a change to a branch (as far as I can tell), the change seems to happen in both the branch and the trunk. This seems manifestly impossible, so I'm wondering if I really understand what switch is supposed to do.
>
svn switch make your working copy look like a specific URL at a given revision,
e.g. switching from trunk to a branch involves only downloading the difference
between the two rather than the whole thing.
Since your working copy is now rooted at a different URL, then any subsequent
operations should happen at that location (i.e. in the branch you switched too).
The trunk should be unaffected. It is possible that only a subdirectory was
switched to the branch so that the changes in that directory went to the branch
and the rest went to the trunk. Since commits are repository wide this
can result
happen within a single transaction, similar tricks are used to fake
partial checkouts.
I would suggest asking on the subclipse list, since the operations and
results were all
viewed through it. Where subclipse roots the operations and how their
repos browser
works will be better known there. You might try examining the files
from the command
line, and diffing them with the trunk to see if the command line shows
the results you
expected. If so it may just be a matter of interpreting the repo
browser incorrectly,
otherwise it may have been an incorrect or buggy invocation of switch.
Hope that helps,
Josh
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: (Silly?) question regarding branch and switch
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 4, 2006, at 22:38, Karl Auer wrote:
> Thanks Josh. Yes I might, but I figured the Subversion users list
> was a better place to ask "what exactly is switch supposed to do".
>
> As I read the SVN book, it is supposed to make your working copy
> look like a specified revision. It is described as a variant of
> update. When I make a change to a branch (as far as I can tell),
> the change seems to happen in both the branch and the trunk. This
> seems manifestly impossible, so I'm wondering if I really
> understand what switch is supposed to do.
>
> Maybe I just need to do more experiments.
You're right, that should be impossible. In Subversion, when you make
a change on a branch, the change gets made on the branch, not on the
branch and the trunk. To propagate the change to the trunk, you have
to use the svn merge command. Try some more tests, using the svn
command line, maybe following the examples in the book if there are
any good ones about switching, and note the results. If anything
strikes you as odd, you can send us your transcript and what happened
and what you think should have happened instead and maybe we can sort
things out.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: (Silly?) question regarding branch and switch
Posted by Karl Auer <ka...@biplane.com.au>.
On Wed, 4 Jan 2006 14:33:57 -0600, Joshua Varner <jl...@gmail.com> wrote:
> > I'm trying to get a grip on branches.
> [...]> You might try one of these lists:
> http://subclipse.tigris.org/servlets/ProjectMailingListList
Thanks Josh. Yes I might, but I figured the Subversion users list was a better place to ask "what exactly is switch supposed to do".
As I read the SVN book, it is supposed to make your working copy look like a specified revision. It is described as a variant of update. When I make a change to a branch (as far as I can tell), the change seems to happen in both the branch and the trunk. This seems manifestly impossible, so I'm wondering if I really understand what switch is supposed to do.
Maybe I just need to do more experiments.
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@biplane.com.au) +61-2-64957160 (w/h)
http://www.biplane.com.au/~kauer/ +61-428-957160 (mob)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: (Silly?) question regarding branch and switch
Posted by Joshua Varner <jl...@gmail.com>.
On 1/4/06, Karl Auer <ka...@biplane.com.au> wrote:
> Hi there.
>
> I'm trying to get a grip on branches.
>
> When I use Subclipse to create a branch, then switch to that branch, I see appropriate log messages (probably broken by my mailer):
You might try one of these lists:
http://subclipse.tigris.org/servlets/ProjectMailingListList
Josh
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: (Silly?) question regarding branch and switch
Posted by Karl Auer <ka...@biplane.com.au>.
Hi there.
I had a problem where Subclipse/Subversion didn't seem to be switching correctly:
> When I use Subclipse to create a branch, then switch to that branch, I see
> appropriate log messages (probably broken by my mailer):
> [...]
> In the project browser, however, the project still shows up as "svntest [svntest/trunk]".
> I was expecting it to change to "svntest [svntest/branches/tb1]".
>
> When I then make a change to a file in the project and commit the change, the change
> appears to have been made in *both* copies, trunk and branch. When I use switch, it
> *seems* to switch (see the log entries above), but the version of the file I get is
> always the changed one, and the label decoration never changes from "[svntest/trunk]".
> The default URL in the "Switch to Branch/Tag" dialog is always the trunk, as if it
> never switched away.
No matter how meticulously I did this, I always saw this effect. I wrote some shell scripts to test the behaviour of "svn switch" directly and it seemed as if Subversion was doing everything correctly.
Then when I attempted to modify the Subclipse preferences I got a message saying that some handler could not be notified.
At this point I decided Eclipse had lost its marbles :-)
I restarted Eclipse, which runs permanently on my Linux box and hadn't been closed for at least two weeks.
Problems gone.
Argh!
My thanks to those who helped clarify switching for me; this problem indirectly taught me a lot about Subversion :-)
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@biplane.com.au) +61-2-64957160 (w/h)
http://www.biplane.com.au/~kauer/ +61-428-957160 (mob)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org