Integrating an established project into Subversion
This post is aim at people who are interested in version control and want to integrate their project into Subversion.
To demonstrate the process I’ve created a little Java project called DBTest, here is its layout.
DBTest
│ build.xml
│
├───lib
│ mysql-connector-java-5.0.7-bin.jar
│
├───resources
│ database.properties
│
└───src
└───net
└───sailes
└───DBTest
DBTest.java
Its nothing special, just one Java class, one property file, one 3rd party library and a build script to pull it all together.
The first thing you need to think about it the layout of your Repository. Obviously if your adding to an existing repository you can follow the existing guidelines. However if your starting from brand new, its worth considering a few questions.
How many separate projects am I liking to create?
No one likes a list of 100 separate folder they have to scroll through, it might be worth considering sub folders.
Who needs access to what projects?
Group together similar projects this will help you create easy to maintain access lists in the future.
Where should I place my trunk, tags and branches folders?
I’ve seen lots of different style, and each have their benefits.
/trunk/projectname/src /src/trunk/projectname /projectname/trunk/srcPersonally I like to be able to version up specific components, so I like to have a different trunk, tags and branches folder for each project. If all your projects are interconnected you may not like this approach.
So now I have an idea of the layout I want, I’m going to use the Tortoise SVN repo browser to create my initial folders.
Type in your repository url and right click the parent folder, giving you the option to “Create folder…”

Give your project folder a name “DBTest”

Now create the default Subversion folders in the same way.

Tortoise SVN gives us a function to be able to import folders into our repository. These are the “Add folder…” or “Add file…” options. This allows you to very quickly import files directly into the repository. But be careful that you don’t add sub folders you don’t need. For example:

Importing the DBTest folder directly into Trunk would give you the paths
/Projects/DBTest/Trunk/DBTest/lib /Projects/DBTest/Trunk/DBTest/resources /Projects/DBTest/Trunk/DBTest/src
Duplicating the project name. You may need to do several folder and file imports to get the structure just how you want it.
Another way is to checkout the Trunk folder as a working copy to your machine.

Then copy your files into the folder structure you want, then to do an svn add.

You can then commit your files once your happy that you’ve not broken anything.
About this entry
You’re currently reading “Integrating an established project into Subversion,” an entry on Svn-Checkout.co.uk
- Published:
- 23.01.08 / 7pm
- Category:
- integration, subversion, tortoise svn
No comments
Jump to comment form | comments rss [?] | trackback uri [?]