You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Urs Thuermann <ur...@isnogud.escape.de> on 2006/06/08 21:42:13 UTC

Making a branch the new trunk

What is the best practice to abandon the current trunk and make some
branch the new trunk?  Say I have created a branch by calling

    svn copy trunk branch/foo

and then make changes on the branch and on the trunk.  After a while I
decide that I won't further develop the trunk version and that
branch/foo should be the new trunk.  I would do it this way:

    svn rm trunk; svn move branch/foo trunk

Is this the correct and best way to do it?  Or are there any drawbacks
or better ways?

urs

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Making a branch the new trunk

Posted by Urs Thuermann <ur...@isnogud.escape.de>.
Peter Werner <l....@vasas.no-ip.org> writes:

> >     svn rm trunk; svn move branch/foo trunk
> 
> I think that is the right way, because history of changes will not be
> lost.

Ah, another aspect I haven't thought of before.  Unfortunately, the
commands above need an intervening svn commit.  Otherwise, SVN fails
with an error message as described elsewhere in this thread.

urs

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Making a branch the new trunk

Posted by Peter Werner <l....@vasas.no-ip.org>.
> I'd like to disagree, here. You may not actually want the vast, detailed 
> history of the branch integrated into the trunk, especially the history of 
> failed changes.

1.
Interesting point.  I agree that there can be such branches where you
experiment, fool around and then merge to trunk.  Here it's an advantage
that you don't have the history.

2.
My guess is that the original question is another usecase where one
branch slowly became the head branch.  It's role is trunk so just the
name has to be changed.

3.
I have a similar use case, and for me the most important is to keep the
complete history.  (If something braks I want to check where it
happened.)

4.
A sidenote, you may want to keep the original trunk as a tag:
svn mv <URL BASE>/trunk <URL BASE>/tags/abandoned-trunk
svn mv <URL BASE>/branches/my-loved-branch <URL BASE>/trunk

5.
I don't know any better way than doing it in two commits.

6.
> ... famous "Cannot replace directory from within" message ...
I tested it and I did not get any messages.  Most probably it is the
result to have some non-versioned files in the directory that prevented
removing it.

Péter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Making a branch the new trunk

Posted by Nico Kadel-Garcia <nk...@comcast.net>.
Peter Werner wrote:
>> What is the best practice to abandon the current trunk and make some
>> branch the new trunk?  Say I have created a branch by calling
>>
>>     svn copy trunk branch/foo
>>
>> and then make changes on the branch and on the trunk.  After a while
>> I decide that I won't further develop the trunk version and that
>> branch/foo should be the new trunk.  I would do it this way:
>>
>>     svn rm trunk; svn move branch/foo trunk
>>
>> Is this the correct and best way to do it?  Or are there any
>> drawbacks or better ways?
>
> I think that is the right way, because history of changes will not be
> lost.
>
> Br, Péter

I'd like to disagree, here. You may not actually want the vast, detailed 
history of the branch integrated into the trunk, especially the history of 
failed changes. By doing an actual "svn merge" operation, coupled with any 
bits that get missed by the merge, you get a much smaller and compact set of 
changes that are easily logged. And if that merge, or the copy operation you 
describe, is done at revision 100, you get a considerably more meaningful 
historical continuity between revisions before the change and after the 
change.

Also, while many source control managers believe that a souce control system 
should never forget anything, I'm of the firm belief that interweaving 
sources causes trouble, since it means you can never discard the branch from 
the repository if you do that sort of "copy" operation. 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Making a branch the new trunk

Posted by Peter Werner <l....@vasas.no-ip.org>.
> What is the best practice to abandon the current trunk and make some
> branch the new trunk?  Say I have created a branch by calling
> 
>     svn copy trunk branch/foo
> 
> and then make changes on the branch and on the trunk.  After a while I
> decide that I won't further develop the trunk version and that
> branch/foo should be the new trunk.  I would do it this way:
> 
>     svn rm trunk; svn move branch/foo trunk
> 
> Is this the correct and best way to do it?  Or are there any drawbacks
> or better ways?

I think that is the right way, because history of changes will not be
lost.

Br, Péter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org