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

Re: Question: Best way to create new branch after changes have already been made to trunk WC

From: Roel Harbers <roel_at_roelharbers.nl>
Date: 2005-04-27 09:29:45 CEST

Mike Harris wrote:
> Here's my situation. I have made changes to my working copy of our
> trunk. After making a week's worth of changes, I now need to shelve the
> changes and move on to something else. What I want to do is check these
> changes into a branch, but my working copy points to the trunk. What is
> the best way to accomplish this? There are a couple ways I know of to
> do it, but they seem sub-optimal.
>
> 1. I could create the branch of trunk, check out a working copy, then
> copy the modified files into the branch working copy and check it in
>
> 2. I don't think this even works, but I could relocate (switch
> --relocate) my WC from trunk to the new branch and check in. This would
> be great, but I don't believe relocate can be used in this fashion.
>
> Any suggestions would be appreciated. Thank you.

Did you commit any of those changes? or are they only in the working copy?

If you haven't made any changes, you can just create a branch directly
in the repository:
svn cp http://server/repo/trunk http://server/repo/branches/mybranch
and then switch (no relocate) to that branch:
svn switch http://server/repo/branches/mybranch localwcpath
then, you can commit the changes (to the branch) and switch back to
trunk (the changes will now be gone from the wc)

if you have commited the changes to trunk, you could rename /trunk to
/branches/mybranch and copy /trunk@<rev before changes> to /trunk (which
is then basically a new trunk, based on the old revision)

Regards,

Roel Harbers

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Apr 27 09:32:42 2005

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

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