0

I set up an SVN repository for my Android project the wrong way and I would appreciated some help correcting it.

I created a standard SVN repository as follows (I did not create a root "svn" folder because I only plan to store one project in this repository):

http://myserver/MyProject
    /trunk
    /branches
    /tags

When I checked in my project it went into the root folder instead of the /trunk folder. So I had the folders:

http://myserver/MyProject
    /trunk
    /branches
    /tags
    /MyProject
        /src
        /res
        /...etc

I've been working this way for a while, using Eclipse and (I think) the Subversive SVN connectors. I know NOTHING about the svn command line. Now I need to move my project to the trunk folder as I should have done from the beginning. I copied the MyProject folder to the trunk folder by copy/pasting in the SVN Repositories view in Eclipse and renamed the old folder, so now I have:

http://myserver/MyProject
    /trunk
        /MyProject
            /src
            /res
            /...etc
    /branches
    /tags
    /MyProject.old
        /src
        /res
        /...etc

How do I get my project to start using /trunk/MyProject? Ever since I renamed /MyProject.old to /MyProject Eclipse cannot find the remote files when I sync. I tried changing the repository location from

http://myserver/MyProject

to

http://myserver/MyProject/trunk

but Eclipse warns that "The repository root URL refers to one of the resources configured as a structure node. Do you wish to normalize the URL by cutting it's last segment off?" If I say Yes I'm back in the same boat and if I say No I get nasty errors when I try to sync.

How do I get my code syncing to the new location? What am I doing wrong? I'd preferably like to keep my revision history and not start over again!

Thanks in advance,

Barry

manojlds
  • 290,304
  • 63
  • 469
  • 417
Barry Fruitman
  • 12,316
  • 13
  • 72
  • 135

2 Answers2

2

The easiest thing to do if you're not familiar with the SVN command line is just to use TortoiseSVN then open up the Repo Browser: Windows Explorer -> File -> TortoiseSVN -> Repo Browser. Now drag and drop your folders or create new ones just like you would in Windows Explorer.

After you've done this, you'll also need to perform a "switch" on your working directory so it points to the new repository path: right-click -> TortoiseSVN -> switch.

Troy Hunt
  • 20,345
  • 13
  • 96
  • 151
1

Have a look at this thread:

How do you move a file in SVN?

I think the best option for you is to put everything back as it was before you copied the folder over. With svn, you have to be careful when you move/copy stuff around, because each folder contains a .svn folder. Inside that folder there are references to the actual repository, so when you modify the underlying file system, you bring the working copy in a very unstable and out of synch state.

If you don't have many local changes, you should probably do a fresh checkout. When you are done with that, you can follow the suggestion in the above thread to use svn commands to move folders/files around.

Community
  • 1
  • 1
crisbia
  • 174
  • 3