• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

SVN : Move existing project to 'trunk' folder

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I have an existing project in SVN created a few weeks ago. I now need to do 2 things:
a) Move the existing project into the trunk folder.
b) Create a branch from my working copy.

I use MyEclipse as IDE.I do have an idea about creating a branch but i am not sure how to move my exisitng project into the 'Trunk' folder.

Can some-one suggest a neat way to do this without messing my exisitng project?

Thanks.
 
Saloon Keeper
Posts: 24810
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Me too. And I'm supposed to know better by now. What's probably the easiest way is to do this:

0. copy your .project and .classpath files to a safe place. Remove all source and build folders from the project so that they won't be locked against moving
1. Export the project as a ZIP file or something.
2. Use Eclipse to create a trunk folder in the existing project
3. Add it to Subversion
4. Unzip the exported copy of the project into the trunk folder
5. Add the contents of trunk to Subversion
6. Subversion delete everything but the trunk, branches and tags folders from original project folder.
7. Fixup any absolute paths that got fouled up. This is the second hardest part. The original root project file is probably useless at this point, but you'll have to create a new project at the trunk level and delete the old project from your workspace before you can free it up for deletion.

The hardest part is that both Subversion and the subclipse plug-in have proven to be less robust than I like. The process will appear to "hang" for long periods of time, run CPU usage up to 100% and I end up killing Eclipse, which causes all sorts of damage to the process which I then have to manually repair. Including going to the backups to restore stuff that got lost in the process. On the whole, the move process is more trustworthy if you do it from the command line. At least you gain comfort from the rows and rows of dots marching across the screen, even though you'll have no clue as to what percentage of the operation is complete.

I'm fairly sure that unlike CVS, the subclipse plugin doesn't adjust the subversion contexts for folders moved in the Resource View and that can lead to major grief. On the whole, I'm not real happy with subversion right now.
 
Suzi Cooper
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That does not sound easy.
Can you point to me if there is a major flaw with the following approach : 1) Through SVN Repository perspective, create a folder 'Trunk'
2)Right-Click and move all the folders/ files under this directory including .project file.
3) Create a new folder 'Branch'
4)From java perspective, (Team--> Branch/Tag) create a branch of the working copy.

Will this mess up any files?
 
Suzi Cooper
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone any pointers?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using Subversive, for a) I would go to the SVN Repositories view and use Refactor/Move To...

For b), using the option from the team menu sounds fine. An alternative would be to use Refactor/Copy To... from the same view as above. (Remember that in SVN a branch/tag is just a copy, anyway.)

I assume that subclipse will provide similar functionality. Alternatively, TortoiseSvn would work, too.
 
Suzi Cooper
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. The suggested ways for both scenarios worked with no major issues.
 
reply
    Bookmark Topic Watch Topic
  • New Topic