1

Here's my problem: I created three separate repos under one project. The repos are "branches" and "trunk" and "tags".

So I know I needed to delete them and have a single repository. I needed to move everything under trunk to the project. So I tried to do this remotely. First I checked out the project and then I deleted "branches" and "tags", both of which were empty.

I did a svn delete and then commit. Next I wanted to get rid of trunk, but it already held files. So what I did was I copied those files into the directory above it:

cp -r trunk/* . 

Now I deleted the trunk:

svn delete trunk/

Okay, so now the project is empty after I did the commit. But I still have those important files that I copied out of the trunk. I want to put them under the project on the remote server, so I would have only one repository holding those files. But those local files still think they belong under the trunk repository, which was deleted. So I then issued this command, which I hoped would fix them:

svn switch --relocate \
svn+ssh://fkim@.../home/fkim/svn/aetv/trunk \
svn+ssh://fkim@.../home/fkim/svn/aetv 

But this did not change anything with those files. When I do svn status, I see that they have the '?' next to them and if I try to add them, I am told that they are already under version control. What should I do? I need to get them all under the project on the remote server.

Please note that I am running everything on Linux. This is work I am doing at the command-line.

3 Answers 3

2

relocate is used to make a working copy point to another URL, which also holds the repo of this working copy (i.e. when the SVN server changes and you don't want to remove the working copy and check it out again).

You seem to want to reimport new files into an empty repo. Except your new files are still "marked" as being part of a working copy.

First checkout the empty trunk dir. This will create an empty working copy. The copy the old working copy to the new one, but remove all the .svn directories. This can be done using the export command. The add all the files and commit to import them into the repo.

Sign up to request clarification or add additional context in comments.

3 Comments

It's not very good solution because we will loose all the history of these files
I agree, but am under the impression that it is what the OP wants. If he wants to migrate from a repo to another one, he will need to export the source repo and import into the target repo. But that's not what he has done.
This seems like the best solution to me because those files don't have a history. I just added them, so starting over by adding them to an empty repo is exactly what I want. Thanks.
1

It is extremely dangerous to modify folders structure (which are under SVN control) manually.

Now you have to do next steps:

  1. Checkout your current project again (don't copy anything inside it!)

    svn co http://your/project/svn/
    
  2. Restore the trunk:

    svn merge -rHEAD:PREV .
    svn ci -m "Trunk restored"
    
  3. Move the trunk contents:

    svn mv trunk/* .
    svn ci -m "Trunk contents moved up"
    
  4. Delete the trunk:

    svn del trunk
    svn ci -m "Trunk deleted"
    

Comments

0

On your local working folder, use TortoiseSVN select "Export" to trim all the svn stuff. Then commit your local folder to another repository. Can this solve your problem?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.