On revisions, tags and branches

From OpenSimulator

Revision as of 10:05, 26 May 2009 by Ideia Boa (Talk | contribs)

Jump to: navigation, search


If you're not acquainted with svn revision numbering schemes, here are a couple of good-to-know points about SVN versioning;

In an SVN repo, the 'revision' is a discrete version of the software. But; the revision number is not an indication of sequential functional increment.

Revisions are based on a revision before it, but that does not have to be the revision immediately before it.

The revision number counter is global to the svn repository, hence it is upped whenever somebody does something within the repo, regardless of what branch the thing happens to.

An example:

  • I commit something to trunk, the rev number is upped to, say, 1337, and my new version is given that number.
  • I now branch trunk into /branches/mybranch. I do this by doing a remote copy of trunk. This copy of trunk, although identical to 1337, is a new version and is thus given the revision number 1338, the first revision on the new branch.
  • Now I commit a number of changes to trunk, spinning past 1339, 1340, 1341 and 1342 - each being separate versions but on the branch called /trunk (think of it as paths)

Now, if I commit some minor change to /branches/mybranch, what revision number will it get? You guessed it - 1343.

If I now commit something to /trunk again, it will get 1344. I then commit something to the really really old branch /branches/reallyoldbranch that was based on, say, revision 666. It will now get 1345.

So, my point is: you should never talk about revision numbers when your're trying to convey an idea of some kind of sequential advancement of state.

Ie, in my example, 1344 is probably the one reflecting the most development, 1343 is essentially based on 1337 and 1345, currently the highest rev number, could basically be six months old, with just a minor modification.

Now on to tags:

Trunk, branches and tags are really all one thing: paths. The only real difference is by convention: there is a certain path called /trunk that serves a certain purpose, namely to be the focal point for developers. There is a certain name used for paths other than trunk, and that is "branches". Some branches by convention aren't meant to be modified, but serve as snapshots of a point in time - they are called "tags".

But to the server, they are all revisions along differerent link paths. There is really nothing stopping you from committing to a tag - it's just the svn client will be reluctant to do so, as it's aware of the convention.

Keep this in mind, when referring to a 'revision' - it might be on a totally different path, so be sure to mention what path you're really talking about. specifying "trunk, between revision 1343 and 1780" or "0.6.2 post-fixes, between revision 1764 and 2006" again lets you compare revision numbers to indicate advancement of state.

Also, don't tell people to check a certain revision out, unless you mean exactly that code snapshot. If you want them to check out a certain version, tell them the logical path ("/branches/0.6.5-post-fixes") to it instead.

Personal tools
General
About This Wiki