Ian McShane Rotating Header Image

Versioning a web development project

This week, i’ve been trying to get my head around workflow using SVN.
As i’ve mentioned before, i have a Ruby/Rails project on the go at the moment and at the start I decided to use SVN for version control – Mostly because DreamHost provide SVN as a one-click-setup job.
Here is a list of what I wanted to achieve, in order:

1. Backup in case I lose my local working copy.
2. Automatic publishing to webserver.
3. A nice way to track changes throughout the project.
4. Be able to publish the changes dynamically to a webpage.

I use TortoiseSVN on my XP installation to manage my working copy.
The first requirement was easy to achieve, so long as I check in regularly I have a nice shiny copy on the SVN server (obviously).
The second was fairly simple. I just checked out the latest version to the root directory for the webserver and run “SVN update” when I want to refresh it.

When I started, I didn’t really have much comprehension of source control from a developer perspective so I just had the root of the SVN repository as my working copy.
I have since read up a bit, taking in the concept of trunk, branches and tags.
Today I spent a couple of hours working out how my folder structure should be and moving everything around using TortoiseSVN to the following structure:


I also changed the web version to use the latest release version using SVN switch %URL_TO_RELEASE_VERSION_IN_TAGS_FOLDER%.

My idea of the workflow is that I make changes to the working copy (a subfolder of branches, i.e /branches/0.1.x) and check in as required.
Once I am happy with the changes, I transfer the changes to the /trunk/ version which can then be accessed via the web for any remote testing I may rope people into.
Once the trunk version has been tested against I can go ahead and make a copy of that into the tags version as the next release, do a SVN switch in the web directory and all is done (along with any config changes to the app’s db of course).

I’m not sure if that is a ‘best practice’ way of running an SVN linked project but it makes sense to me and would seem to work out in an environment where there was more than one developer working on it.

Like I said, it makes sense to me but maybe I have missed the point and made some fundemental error somewhere?
For example, I still don’t get the ‘Patch’ part of SVN, would it be possible to just update the web directory using a patch from the latest release rather than running SVN update?

I’ve also been looking been looking into a product called Trac which appears to be a good project management/defect tracking application, anyone had any dealings with it? From research it looks like a pain in the ass to install (to Dreamhost at least)

Leave a Reply

Your email address will not be published. Required fields are marked *