views:

236

answers:

4

I am looking here for some hints and tips on how to manage multiple versions of a projet.

Currently I have a development version of the application which includes some improvements and new functionnalities. In meanwhile I have to do some bug resolving. It is easy to fix the bugs on files that have not been touched by new functionnalitites but as soon as I touch the page that have the new func. I need to comment several lines of code each time. I feel it is not the best way to play around. There must be a method good enought to solve this issue.

On another side of the problem is the deployment. It is quite often that I must wait several weeks before uploading a new functionnality on the website. In meanwhile I tend to forget sometimes each files that have been modified (or commented for bugs) and it can create errors. I have heard of capistrano for ruby fans, could that help me ? I am mostly a PHP/asp.net developper.

A: 

One way to do this is to create a branch in your source control software.

Nippysaurus
Hum yeah I thought about that ... installing subversion on the production server and deploying via a commit ... but it sounds weird a little bit to me.
Erick
You don't have to install subversion on the production server. Checkout a version on a dev machine and ftp/ssh/scp/whatever it to the production server.
Ryan Doherty
+4  A: 

Most version control systems have the ability to "branch" your software, so that you can have multiple versions of the same code-base going at the same time.

For example, your "1.0" branch might be the current production version. For new development, you might create a "1.1" branch, which starts off as a copy of 1.0. All your new features should go in 1.1, and any production bug fixes should go in 1.0 (and eventually 1.1 too). There are usually tools available to merge changes between branches (e.g. merge bug fixes from 1.0 to 1.1).

Here is a good description of subversion branching.

http://svnbook.red-bean.com/en/1.1/ch04.html

Check your current version control system for how it handles branching.

Andy White
+5  A: 

You are experiencing the classical case of "incompatible development effort":
you cannot both fix a bug and develop on the same file on the same time.

This is a classical case for branching, which would allow for a same file to:

  • freeze its state to the one initially deployed (stating point for the branch)
  • fix the bug in a bugfix branch
  • retrofit some of those bugs into the current development branch
  • develop new features in the development branch.

If you are not comfortable with the immediate setup of a VCS (Version Control System), you could at least duplicate the tree of files representing your server into 2 directories (one 1.0 and one 'DEV'), effectively doing some "manual" revision control.
Then a tool like WinMerge would help you to track the difference and do some merging

But a true VCS would be more efficient, and can be used as a stable source for deployment, as illustrated by this Best version-control for a one-man web-app question (with subversion).
That version-controlled source can also be used by a deployment system like capistrano.

VonC
Very well explained and nice resources, thanks
Erick
@Erick glad I could help.
VonC
A: 

Source Control System is the solution for you. Most of them have a way to handle different versions of a project, for example perforce, svn, etc. You can create as many versions as you want using branches in Perforce. Any change in any version needs to be merged to all the higher versions. I found peforce merge very comfortable. Every new version starts from the copy of its earlier version. You can develop some control scripts and configure perforce which will alert any changes to previous version not done in higher versions.

Bhushan