views:

40

answers:

3

I have two checkouts of one trunk of a project via SVN. One is the 'Feature Checkout', which includes work on new features/upgrades, that will rolled out to production code every few months. The second is the 'Support Checkout', which is for any small day-to-day bug fixes that arise.

My Feature Checkout already contains a lot of code that I can't afford to lose, but is far from being ready to go live. What I am looking to do is to create a new branch of the project based on what is currently in my feature checkout, while the the support checkout should remain a copy of what is currently live.

How can I create a new branch with the current code I have, and once I have, how to I go about moving changes from one to the other (both from support/live -> feature and vice versa)?

A: 

I would make a branch from the rev you checked out, and then apply your changes from your checkout to the new branch checkout

ocdcoder
A: 

To checking existing working copy changes to a new branch:

  1. Start in the base of your working copy

    cd /your/working_copy_dir

  2. Look at the current base revision your support branch is checked out from

    svn info your_working_directory

  3. Create a branch in svn

    svn copy repourl/trunk@checked_out_revision repourl/branches/supportversion

  4. Switch your support working copy to the new branch

    svn switch repourl/branches/supportversion

  5. Check in your changes to new support branch

    svn commit

To merge changes between branches:

svn merge ...

But you owe it to yourself to checkout a distributed version control system. This is a good read that applies to git/hg/bzr, etc: http://hginit.com

Nathan Kidd
thanks for the links to other version control systems, but this is for my job, so I don't have any say in what system is used.
GSto
+2  A: 

You can create branches right from a working copy. Go to the feature working copy and:

svn copy c:\featureWC http://server/svn/repos/branches/MyNewFeature

Don't forget to switch afterwards:

svn switch c:\featureWC http://server/svn/repos/branches/MyNewFeature
Sander Rijken
This works too, but keep in mind that copying your wc like this means you'd preserve any mixed wc state (different files updated to different revisions); for easy merging between support branch and trunk you probably do not want this, though it is less likely you'll have a mixed wc..
Nathan Kidd
Good point, only do that with the working copy at a single revision
Sander Rijken