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

Re: Making a copy of the trunk

From: <svnlgo_at_mobsol.be>
Date: 2007-10-16 19:47:58 CEST

Quoting Brian Erickson <erickson@BAUERCONTROLS.com>:

> HI all,
>
> This question was submitted back in Aug...
>
> >We're finising a major release of my project here. Once we release we
> >want
> >to copy its branch to the subversion trunk.
> >
> >The key word there is 'copy' -- because this is pretty much a complete
> >restructuring of our code, the decision was made (before I got here)
> >that we wanted to replace the trunk, not merge to it.
> >
> >My plan is to do an svn rename on the current trunk, to something like
> >trunk_old,
> >And the an svn copy of the current branch to trunk.
> >
> >Is there a better way to do that?
>
> I find myself in a similar situation. I didn't see any responses to the
> 'Is there a better way?' question so I'm posing it again. Is there a
> better way?

Well, there's another way, but it depends on your situation if that's a better
way or not.

The benefit of renaming trunk and copying your current branch to the new trunk,
is that when you look at the history of trunk you'll see all your commits
actually made in the branch. Your commits made on trunk while the branch was
active will not be lost, but you won't see them anymore in the history of
trunk.

If that's not what you want, you can use the copy-merge method. The copy-merge
method is in fact a merge, but instead of choosing two revisions of one branch
to merge from, you'll compare two url's trunk@HEAD and branch@HEAD. Basically
it means during the merge, svn compares your trunk and your branch, then merges
the differences between them to trunk. The end result is that your trunk is
identical to the branch.

With subversion you would do the copy-merge like this:
svn http://svnserver/trunk http://svnserver/current-branch
/working/copy/of/trunk

Note: any changes you made on trunk while working on the branch will be
overwritten this way. If you don't want that, you should bring the branch up to
date (merge) with any changes on trunk you still need, then do the copy-merge
back to trunk. In fact, this whole pattern is explained in the svn book:
http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.branchmerge.commonuses.patterns.feature
.

hth,

Lieven

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 16 19:48:23 2007

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.