views:

499

answers:

6

Not long ago we were using Microsoft VSS as our version control tool, and used to create branch of our code after the end of every release and deploy that to our clients.

Now we have moved to SVN and lately there have been lot of discussion about tags/branches, should we tag/branch our code after development for a particular release?

SVN actually recommends "tags" for such a purpose, but also recommend not to make any changes to that further, so where will we make heinous bug fixes that comes up for this release?

Another thing that is doing round is to create both tag and branch, deploy tag to clients, and incase any bug(s) comes up, fix will be made to branch and then tagged again :-(

What do other people do?

A: 

Tags on a release branch.

Hank Gay
+2  A: 

Yes, you typically create a maintenance branch parallel to trunk, and you tag bug fix releases out of that.

Martin v. Löwis
+4  A: 

In Subversion they are the same thing - they are implemented the same way and the results are the same (aside from your repo hierarchy). They are just references to a specific revision of the repository. No real copies are made. When you start working on a branch (in the real sense of the word) then you are using a new copy of that resource in a new place.

You can always make a branch out of a tag if/when you need, so there is no reason to make a branch and a tag.

If it helps you to be consistent, then go ahead and do it, but in reality it isn't doing anything until you start checking in/making revisions to a branch.

(the tag/branch are both made with a cp command)

Tim
to add to this at work have the convention that a tag is forever, but a branch is just for a change/fix
Andrew Cox
yes - that is what the intention is, and the conventional meaning of those words. The svn book suggests this also.
Tim
I hate to admit it, but it finally dawned on me that the best (simplest and clearest) approach is to first tag and then branch from the tag (not from the trunk). True deletes would be nice at some point though, since they can accumulate.
EnocNRoll
A: 

Since the source control concept is still pretty new here, especially SVN, we work off the trunk alone. Works great until we have commits that aren't supposed to go live yet, and the person deploying at the time isn't aware of that.

Once everyone is comfortable with SVN here and I can get at least one other person familiar with merging, I'm going to setup a 'live' branch where all approved commits for production can be merged into.

Tags are nice because you can put names to a development cycle, 'beta', 'alpha', 'release candidate 1', etc. But the most important thing you need is a good branch you can rely on for production use. Tags just make it easier to determine milestones.

Adam
+5  A: 
  1. when you make a release, create a tag for it. E.g., release-1.1.0
  2. if you have a bugfix/change for that release, create first a branch from that tag, that's the 'stabilization branch', usually named with an '.x' as the last version number. E.g., stabilization-1.1.x
  3. merge the bugfix/change from trunk to the stabilization branch
  4. commit the change to the stabilization branch
  5. once you feel that enough bugfixes/changes on the stable branch are there to justify a new release, create a tag from the stabilization branch, e.g., release-1.1.1
  6. keep working on trunk, merge bugfixes back to the stable branch
  7. repeat 3-6
Stefan
@Stefan - would you elaborate on line 3. ? What happens if your trunk contains new features or incompatibilities with release-1.1.0, by merging aren't you forcing these into the 1.1.0 version?
Otávio Décio
not into the 1.1.0 tag, you should merge those to the stabilization-1.1.x branch. But of course, only those changes you want to have in the next minor release (i.e., 'release-1.1.1')
Stefan
@Stefan - thank you; but what happens if you have more recent releases, i.e., 2.1.0, wouldn't the merge put features from that into the release-1.1.1?
Otávio Décio
Only if you specifically merge those changes to that branch. If you have a more recent release, then you also (should) have a tag for it and another stable branch (e.g. release-2.1.0 and stable-2.1.x) to where you then merge your changes.
Stefan
Hi Stefan, this is a side question, but do you know of any CI servers that can deploy code when you tag a release in SVN? I am using CruiseControl.Net but I don't see a trigger for this. thanks!
AbeP
+1  A: 

Create a tag on the specific revision of a code line (e.g. trunk) and ALWAYS do releases from your tags. Tags in svn, while not enforced by svn itself, are meant to be snapshots and reference points. Take advantage of that implicit notion and only release a build created from a tag that you, and others, know corresponds to a specific release.

Use branches for committing maintenance patches to a specific release (e.g. create a branch from your tag if you need to patch your release) and follow the same for your patches by by tagging your branch when you release from it also.

whaley