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

Re: Switch without updating

From: mark benedetto king <mbk_at_boredom.org>
Date: 2003-02-06 04:15:26 CET

On Thu, Feb 06, 2003 at 08:33:34AM +0530, M. S. Sriram wrote:
>
> One such feature is being able to check a (modified from a base version)
> working copy into a new branch, doing development there and later merging
> back. I'm trying to figure out how to accomplish this in subversion, and I
> can't seem to get a good handle on it: the only solution I have come up with
> involves a similar approach to that for vendor branches, which seems
> needlessly complex for what I think of as a simple operation.

If I understand you correctly, this is what I consider to be a pretty
common case: one starts some development, *then* realizes that the
change is going to be worthy of its own branch. Basically, you want
retroactive branching!

Luckily, svn can accomplish this beautifully.

Let's say you check out a wc:

svn co file://path/to/repo/trunk wc

Then you do a bunch of work, and realize that work should have been
on a branch. The first thing you'd need to do is actually create the
branch:

svn cp file://path/to/repo/trunk file://path/to/repo/branches/foo

Note that this is a purely-repository based operation; the WC is not
involved. Then you'd just need to switch the WC to the new branch:

svn switch file://path/to/repo/branches/foo

This will switch the WC over to the new branch, merging in local changes.

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 6 04:16:17 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.