You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Torgeir Veimo <to...@pobox.com> on 2008/02/29 14:44:47 UTC

svn switch when rebasing repository?

I've changed our repository to use paths such as svn://hostname/ 
projectname/trunk instead of svn://hostname/trunk etc using dump and  
load with --parent-dir.

However changing working copy repositories for developers has been a  
bit more difficult. I've tried svn switch, but i get errors like

Macintosh:src2 torgeir$ svn switch svn://hostname/project
svn: Failed to add directory 'trunk': object of the same name already  
exists

I',m trying this from within the src2 directory, which contains the  
trunk and branches subdirectories, some of which has local changes.

svn switch --relocate seems to be only for changing the actual hostname?

Any ideas? Should I rather go for a diff / patch approach, or write a  
sed script that changes urls in each .svn/entries file?


-- 
Torgeir Veimo
torgeir@pobox.com




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

Re: svn switch when rebasing repository?

Posted by John Peacock <jo...@havurah-software.org>.
Ryan Schmidt wrote:
>> I also committed a new directory, the /project directory before i did 
>> the load, so I assume the revision numbers are off by one. Would this 
>> give the above error message?
> 
> In your situation, you should throw out all existing working copies and 
> check out new ones.

...after running 'svn diff > /safe/location/local_changes.diff` that is.

John

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

Re: svn switch when rebasing repository?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 29, 2008, at 09:29, Torgeir Veimo wrote:

> On 29 Feb 2008, at 15:17, John Peacock wrote:
>> Torgeir Veimo wrote:
>>> I',m trying this from within the src2 directory, which contains  
>>> the trunk and branches subdirectories, some of which has local  
>>> changes.
>>> svn switch --relocate seems to be only for changing the actual  
>>> hostname?
>>
>> No, 'switch --relocate' actually functions by rewriting the  
>> locally stored metadata as strings.  This is precisely what you  
>> should use in this case, since you changed the repo out from under  
>> the working copies.
>
> This is what I get
>
> Macintosh:src torgeir$ svn switch --relocate svn://hostname svn:// 
> hostname/project
> svn: 'svn://hostname/project' is not the root of the repository
>
>
>> IMPORTANT NOTE: if you filtered *any* revisions out when you did  
>> the dump/reload, you will have to throw away these working copies,  
>> as they will no longer be in sync with the repo; i.e. they will  
>> think you are at revision 1234, but the repo will think it is at  
>> revision 1111, and you will be unable to do anything.  You can  
>> always retain your local changes by running 'svn diff' (which  
>> doesn't contact the repo at all) and squirrel those changes away  
>> to reapply after you recheckout the code.
>
>
> I did actually filter out one single commit. I did not drop that  
> commit using --drop-empty-revs or --renumber-revs.
>
> I also committed a new directory, the /project directory before i  
> did the load, so I assume the revision numbers are off by one.  
> Would this give the above error message?

In your situation, you should throw out all existing working copies  
and check out new ones.




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

Re: svn switch when rebasing repository?

Posted by Torgeir Veimo <to...@pobox.com>.
On 29 Feb 2008, at 15:17, John Peacock wrote:

> Torgeir Veimo wrote:
>> I',m trying this from within the src2 directory, which contains the  
>> trunk and branches subdirectories, some of which has local changes.
>> svn switch --relocate seems to be only for changing the actual  
>> hostname?
>
> No, 'switch --relocate' actually functions by rewriting the locally  
> stored metadata as strings.  This is precisely what you should use  
> in this case, since you changed the repo out from under the working  
> copies.

This is what I get

Macintosh:src torgeir$ svn switch --relocate svn://hostname svn:// 
hostname/project
svn: 'svn://hostname/project' is not the root of the repository


> IMPORTANT NOTE: if you filtered *any* revisions out when you did the  
> dump/reload, you will have to throw away these working copies, as  
> they will no longer be in sync with the repo; i.e. they will think  
> you are at revision 1234, but the repo will think it is at revision  
> 1111, and you will be unable to do anything.  You can always retain  
> your local changes by running 'svn diff' (which doesn't contact the  
> repo at all) and squirrel those changes away to reapply after you  
> recheckout the code.


I did actually filter out one single commit. I did not drop that  
commit using --drop-empty-revs or --renumber-revs.

I also committed a new directory, the /project directory before i did  
the load, so I assume the revision numbers are off by one. Would this  
give the above error message?

-- 
Torgeir Veimo
torgeir@pobox.com




Re: svn switch when rebasing repository?

Posted by John Peacock <jo...@havurah-software.org>.
Torgeir Veimo wrote:
> I',m trying this from within the src2 directory, which contains the 
> trunk and branches subdirectories, some of which has local changes.
> 
> svn switch --relocate seems to be only for changing the actual hostname?

No, 'switch --relocate' actually functions by rewriting the locally 
stored metadata as strings.  This is precisely what you should use in 
this case, since you changed the repo out from under the working copies.

IMPORTANT NOTE: if you filtered *any* revisions out when you did the 
dump/reload, you will have to throw away these working copies, as they 
will no longer be in sync with the repo; i.e. they will think you are at 
revision 1234, but the repo will think it is at revision 1111, and you 
will be unable to do anything.  You can always retain your local changes 
by running 'svn diff' (which doesn't contact the repo at all) and 
squirrel those changes away to reapply after you recheckout the code.

HTH

John

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