+1  A: 

It gives a simple, unambiguous version number without needing to arbitrarily decide what version any given code push will be.

bdonlan
+5  A: 

So that when a user complains the support guys can ask him what version it was. It may happen that the user sees a problem, than the site software is updated and his complain is no longer relevant so the developers will waste time trying to reproduce.

That number is the SVN revision number. It starts at zero and increments automatically with each source code add/update over the life of SVN repository. Knowing this number it is easy to get the full source code exactly in the corresponding state - the repository has a method for that.

sharptooth
+3  A: 

On Traditional Software you have Version Numbers like 1.0, 1.1, 2.0 etc., mainly for support and marketing purposes.

On Websites, usually there is no concept of Version numbers, as they are normally changed much much much more often than "traditional" software. Also, sometimes there are just "architecture" changes, as in "a little optimization here, a little cleanup there" - changes that also happen in "traditional" software, but that usually do not warrant releasing a new version (and increasing the version from 1.0 to 1.0.1)

So instead of just increasing some arbitrary number every two days, StackOverflow has decided to use the Revision number from their source control (Which is Subversion, but every Source Control system has some number to identify checkins).

Michael Stum
Thanks. This version number is generated automatically or through settings? How can we track this version change and get a file for this version?
Shoban
The version is incremented automatically by the repository itself. The repository interface has a method for retrieveing all the sources given the revision number.
sharptooth
The source code repository essentially keeps copies of all versions of the file. If you change a file three times, you have a total of 4 versions of the file (Original, First Change, Second Change, Third Change). Each Checkin/Commit to the repository increments it's number. So if I have Version 1 and I add a File, the Repository will be Version 2. I change the File, Repository is Version 3 etc. So the number is incremented automatically and can be easily queried for display.
Michael Stum
+1  A: 

Another reason to publish your revision number is to help you with testing. If you're tracking down a bug or testing a release candidate, showing the revision number can keep you from getting confused as to which version you are currently testing.

Gazzonyx
+1  A: 

If you are using CruiseControl.Net, you can capture the SVN revision to the .state file using this: http://code.google.com/p/svnrevisionlabeller/.

Then query the XML in the state file and display it where you'd like.

XDocument stateFileRoot = XDocument.Load("path-to-state-file");

var q = (from label in stateFileRoot.Descendants("Label")
      select (string)label).SingleOrDefault();

if (q != null)
{
    result = q.ToString().Substring(0, q.LastIndexOf(".")); // lop off last digit
    HttpContext.Current.Application["BuildLabel"] = result;
}

(In this case I put it into the cache for easy access and performance.)

Matt Sherman
Blogged it a little more thoroughly: http://clipperhouse.com/blog/post/Displaying-the-SVN-revision-number-in-your-web-app.aspx
Matt Sherman