[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: M. S. Sriram <mssriram_at_mssriram.com>
Date: 2003-02-06 18:02:56 CET

> 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

        Yes, this is exactly how I wanted it to work. It's wonderful when your
mental model actually matches reality ...

        I was somewhat confused by the subversion book, which (at least in my
slightly old version) mentions switch only in the context of updating to the
tip of the branch --- there's no mention of merging in WC changes. And since
I haven't managed to compile subversion yet, I haven't actually been able to
try it out.

        Anyway, thanks for the information --- you just made my evening.

- Sriram

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 6 18:05:06 2003

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