You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Reuben Avery <re...@swirl.net> on 2007/12/20 21:27:43 UTC

how to completely replace the trunk of a repo with one of its branches?

hi all,
strange thing to do, I know..  I have a branch of my project that is so very
different now from its old trunk and there is absolutely nothing in the
trunk which I wish to merge with what is in the branch -- i just want it to
be there for historical purposes.

anyone have a quick tip on this?

thank you :) :)


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by Hari Kodungallur <hk...@gmail.com>.
On Dec 20, 2007 1:27 PM, Reuben Avery <re...@swirl.net> wrote:

>  hi all,
> strange thing to do, I know..  I have a branch of my project that is so
> very different now from its old trunk and there is absolutely nothing in the
> trunk which I wish to merge with what is in the branch -- i just want it to
> be there for historical purposes.
>
> anyone have a quick tip on this?
>
>
You already have it set up. The branch and trunk are nothing but versioned
directories. Use branch as if it is your trunk and keep the trunk untouched
:-)
Actually, if you do want the branch to be called "trunk", just move (svn mv)
the trunk to a location (say tags/old_trunk, archives/trunk or some location
like that) and move (svn mv) your branch to trunk.

Thanks,
-Hari

RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Fouts Christopher (QNA RTP PT PREV)" <Ch...@qimonda.com>.
>-----Original Message-----
>From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com]
>Sent: Monday, January 21, 2008 2:36 PM
>To: Fouts Christopher (QNA RTP PT PREV)
>Cc: subversion-users
>Subject: Re: how to completely replace the trunk of a repo
>with one of its branches?
>
>On Jan 21, 2008, at 10:07, Fouts Christopher (QNA RTP PT PREV) wrote:
>
>>> Uh.... I really don't think so. I think "switch" does not
>do what you
>>> think it does.
>>>
>>> What Reuben could do, though, is:
>>>
>>> svn rm url://to/repo/trunk -m "removing old trunk"
>>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk -m
>>> "creating new trunk as copy of somebranch"
>>
>> Ryan, et al, I'm about to do this. How will these affect existing
>> branches that have to-from tags with the trunk before the
>rm/cp trunk
>> procedure?
>
>It won't affect them at all? I don't really understand the question.
>In what way do you think tags might be affected?
>

Ok lemme explain...
- I branched from the current trunk, say branchA
- I branched (second one) from the current trunk, say branchB
- I created tags trunk-to-branchB from trunk,
  and branchB-to-trunk from branchB
- I delete current trunk
- I cp branchA (not branchB) to trunk

Can I still do svn merge //.../trunk-to-branchB //.../trunk?
If understand SVN correctly, the answer is YES, but I wanted
to make sure.

-chris


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


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 21, 2008, at 10:07, Fouts Christopher (QNA RTP PT PREV) wrote:

>> Uh.... I really don't think so. I think "switch" does not do
>> what you think it does.
>>
>> What Reuben could do, though, is:
>>
>> svn rm url://to/repo/trunk -m "removing old trunk"
>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk
>> -m "creating new trunk as copy of somebranch"
>
> Ryan, et al, I'm about to do this. How will these affect existing
> branches that have to-from tags with the trunk before the rm/cp trunk
> procedure?

It won't affect them at all? I don't really understand the question.  
In what way do you think tags might be affected?


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

RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Fouts Christopher (QNA RTP PT PREV)" <Ch...@qimonda.com>.
>-----Original Message-----
>
>On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>
>> I am sure you would have thought of this, but the easiest way and to
>> keeping with the concept of trunk I would do the following.
>>
>> svn co trunk trunk-wc
>> svn del everything under trunk-wc
>> svn commit trunk-wc
>>
>> svn co branch branch-wc
>> svn switch branch-wc to trunk
>> svn commit
>>
>> This should make your branch identical to trunk
>
>Uh.... I really don't think so. I think "switch" does not do
>what you think it does.
>
>What Reuben could do, though, is:
>
>svn rm url://to/repo/trunk -m "removing old trunk"
>svn cp url://to/repo/branches/somebranch url://to/repo/trunk
>-m "creating new trunk as copy of somebranch"
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: users-help@subversion.tigris.org
>

Ryan, et al, I'm about to do this. How will these affect existing
branches that have to-from tags with the trunk before the rm/cp trunk
procedure?

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


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 22, 2008, at 09:46, Fouts Christopher (QNA RTP PT PREV) wrote:

>>> What Reuben could do, though, is:
>>>
>>> svn rm url://to/repo/trunk -m "removing old trunk"
>>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk -m
>>> "creating new trunk as copy of somebranch"
>>
>> Ryan, et al, I'm about to do this. How will these affect
>> existing branches that have to-from tags with the trunk before
>> the rm/cp trunk procedure?
>
> I don't know if my response went through yesterday.
> Here's what I mean.
>
> - I create 2 branches off trunk branchA and branchB
> - I create merge tags for branchA/trunk merges, called
>   trunk-to-branchA and branchA-to-trunk for example
> - I develop on branchA and branchB
> - I svn rm //.../trunk
> - I svn cp //.../branchB //.../trunk
>
> Can I still then svn merge //.../trunk-to-branchA //.../trunk
> to merge trunk onto my branchA for example? If I understand
> SVN correctly, this should be ok, but just wanted the experts'
> opinions.

Ah, I don't know if that usage of tags will still work. I don't use  
tags in that way. Maybe you'll need to specify the --ignore-ancestry  
option when you merge. I'm not sure. You should test this scenario in  
a throwaway repository and make sure things work ok for you before  
doing this in your main repository.


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

RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Fouts Christopher (QNA RTP PT PREV)" <Ch...@qimonda.com>.
 >>-----Original Message-----
>>
>>On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>>
>>> I am sure you would have thought of this, but the easiest
>way and to
>>> keeping with the concept of trunk I would do the following.
>>>
>>> svn co trunk trunk-wc
>>> svn del everything under trunk-wc
>>> svn commit trunk-wc
>>>
>>> svn co branch branch-wc
>>> svn switch branch-wc to trunk
>>> svn commit
>>>
>>> This should make your branch identical to trunk
>>
>>Uh.... I really don't think so. I think "switch" does not do what you
>>think it does.
>>
>>What Reuben could do, though, is:
>>
>>svn rm url://to/repo/trunk -m "removing old trunk"
>>svn cp url://to/repo/branches/somebranch url://to/repo/trunk -m
>>"creating new trunk as copy of somebranch"
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>>For additional commands, e-mail: users-help@subversion.tigris.org
>>
>
>Ryan, et al, I'm about to do this. How will these affect
>existing branches that have to-from tags with the trunk before
>the rm/cp trunk procedure?

I don't know if my response went through yesterday.
Here's what I mean.

- I create 2 branches off trunk branchA and branchB
- I create merge tags for branchA/trunk merges, called
  trunk-to-branchA and branchA-to-trunk for example
- I develop on branchA and branchB
- I svn rm //.../trunk
- I svn cp //.../branchB //.../trunk

Can I still then svn merge //.../trunk-to-branchA //.../trunk
to merge trunk onto my branchA for example? If I understand
SVN correctly, this should be ok, but just wanted the experts'
opinions.

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


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Ryan Schmidt wrote:
> On Dec 21, 2007, at 08:59, Fouts Christopher (QNA RTP PT PREV) wrote:
> 
>>> On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>>>
>>>> I am sure you would have thought of this, but the easiest way and to
>>>> keeping with the concept of trunk I would do the following.
>>>>
>>>> svn co trunk trunk-wc
>>>> svn del everything under trunk-wc
>>>> svn commit trunk-wc
>>>>
>>>> svn co branch branch-wc
>>>> svn switch branch-wc to trunk
>>>> svn commit
>>>>
>>>> This should make your branch identical to trunk
>>>
>>> Uh.... I really don't think so. I think "switch" does not do
>>> what you think it does.
>>>
>>> What Reuben could do, though, is:
>>>
>>> svn rm url://to/repo/trunk -m "removing old trunk"
>>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk
>>> -m "creating new trunk as copy of somebranch"
>>
>> I'd have done this too. However, if Reuben changes his mind and wants
>> the old trunk back, the revision he removed, how can he get it back?
> 
> svn rm url://to/repo/trunk -m "removing new trunk"
> svn cp url://to/repo/trunk@FOO url://to/repo/trunk -m "reinstating old
> trunk from rFOO"
> 
> where FOO is a revision in which the old trunk still existed.

Note that this syntax won't yet work.  Peg revision syntax (e.g., "PATH@REV")
for copy is part of 1.5.  Using normal revision syntax ("-rREV"), should still
accomplish what you are trying to do here, though.

-Hyrum


RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Fouts Christopher (QNA RTP PT PREV)" <Ch...@qimonda.com>.
>-----Original Message-----
>From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com]
>Sent: Friday, December 21, 2007 10:11 AM
>To: Fouts Christopher (QNA RTP PT PREV)
>Cc: subversion-users
>Subject: Re: how to completely replace the trunk of a repo
>with one of its branches?
>
>On Dec 21, 2007, at 08:59, Fouts Christopher (QNA RTP PT PREV) wrote:
>
>>> On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>>>
>>>> I am sure you would have thought of this, but the easiest
>way and to
>>>> keeping with the concept of trunk I would do the following.
>>>>
>>>> svn co trunk trunk-wc
>>>> svn del everything under trunk-wc
>>>> svn commit trunk-wc
>>>>
>>>> svn co branch branch-wc
>>>> svn switch branch-wc to trunk
>>>> svn commit
>>>>
>>>> This should make your branch identical to trunk
>>>
>>> Uh.... I really don't think so. I think "switch" does not
>do what you
>>> think it does.
>>>
>>> What Reuben could do, though, is:
>>>
>>> svn rm url://to/repo/trunk -m "removing old trunk"
>>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk -m
>>> "creating new trunk as copy of somebranch"
>>
>> I'd have done this too. However, if Reuben changes his mind
>and wants
>> the old trunk back, the revision he removed, how can he get it back?
>
>svn rm url://to/repo/trunk -m "removing new trunk"
>svn cp url://to/repo/trunk@FOO url://to/repo/trunk -m
>"reinstating old trunk from rFOO"
>
>where FOO is a revision in which the old trunk still existed.
>

Is this same as...
svn cp -rFOO url://to/repo/trunk url://to/repo/trunk -m "reinstating old trunk from rFOO"

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


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 21, 2007, at 08:59, Fouts Christopher (QNA RTP PT PREV) wrote:

>> On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>>
>>> I am sure you would have thought of this, but the easiest way and to
>>> keeping with the concept of trunk I would do the following.
>>>
>>> svn co trunk trunk-wc
>>> svn del everything under trunk-wc
>>> svn commit trunk-wc
>>>
>>> svn co branch branch-wc
>>> svn switch branch-wc to trunk
>>> svn commit
>>>
>>> This should make your branch identical to trunk
>>
>> Uh.... I really don't think so. I think "switch" does not do
>> what you think it does.
>>
>> What Reuben could do, though, is:
>>
>> svn rm url://to/repo/trunk -m "removing old trunk"
>> svn cp url://to/repo/branches/somebranch url://to/repo/trunk
>> -m "creating new trunk as copy of somebranch"
>
> I'd have done this too. However, if Reuben changes his mind and wants
> the old trunk back, the revision he removed, how can he get it back?

svn rm url://to/repo/trunk -m "removing new trunk"
svn cp url://to/repo/trunk@FOO url://to/repo/trunk -m "reinstating  
old trunk from rFOO"

where FOO is a revision in which the old trunk still existed.

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

RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Fouts Christopher (QNA RTP PT PREV)" <Ch...@qimonda.com>.
>-----Original Message-----
>From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com]
>Sent: Friday, December 21, 2007 2:27 AM
>To: Srilakshmanan, Lakshman
>Cc: Reuben Avery; subversion-users
>Subject: Re: how to completely replace the trunk of a repo
>with one of its branches?
>
>On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:
>
>> I am sure you would have thought of this, but the easiest way and to
>> keeping with the concept of trunk I would do the following.
>>
>> svn co trunk trunk-wc
>> svn del everything under trunk-wc
>> svn commit trunk-wc
>>
>> svn co branch branch-wc
>> svn switch branch-wc to trunk
>> svn commit
>>
>> This should make your branch identical to trunk
>
>Uh.... I really don't think so. I think "switch" does not do
>what you think it does.
>
>What Reuben could do, though, is:
>
>svn rm url://to/repo/trunk -m "removing old trunk"
>svn cp url://to/repo/branches/somebranch url://to/repo/trunk
>-m "creating new trunk as copy of somebranch"
>

I'd have done this too. However, if Reuben changes his mind and wants
the old trunk back, the revision he removed, how can he get it back?

-chris

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


Re: how to completely replace the trunk of a repo with one of its branches?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 20, 2007, at 17:33, Srilakshmanan, Lakshman wrote:

> I am sure you would have thought of this, but the easiest way and  
> to keeping with the concept of trunk I would do the following.
>
> svn co trunk trunk-wc
> svn del everything under trunk-wc
> svn commit trunk-wc
>
> svn co branch branch-wc
> svn switch branch-wc to trunk
> svn commit
>
> This should make your branch identical to trunk

Uh.... I really don't think so. I think "switch" does not do what you  
think it does.

What Reuben could do, though, is:

svn rm url://to/repo/trunk -m "removing old trunk"
svn cp url://to/repo/branches/somebranch url://to/repo/trunk -m  
"creating new trunk as copy of somebranch"

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

RE: how to completely replace the trunk of a repo with one of its branches?

Posted by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au>.
Hi Reuben,
 
I am sure you would have thought of this, but the easiest way and to
keeping with the concept of trunk I would do the following.
 
svn co trunk trunk-wc
svn del everything under trunk-wc
svn commit trunk-wc
 
svn co branch branch-wc
svn switch branch-wc to trunk
svn commit 
 
This should make your branch identical to trunk
 
Thanks
Lakshman
________________________________

From: Reuben Avery [mailto:reuben@swirl.net] 
Sent: Friday, 21 December 2007 8:28 AM
To: subversion-users
Subject: how to completely replace the trunk of a repo with one of its
branches?


hi all,
strange thing to do, I know..  I have a branch of my project that is so
very different now from its old trunk and there is absolutely nothing in
the trunk which I wish to merge with what is in the branch -- i just
want it to be there for historical purposes.

anyone have a quick tip on this?

thank you :) :)


================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================