Warning this article may contain opinions of the author that you and iTWire don't agree with.
Visit the last page to have your say in our forum.

No. 1 Story

Telstra adds one million mobile services, but Sensis plummets

Telstra has revealed the addition of almost one million new mobile services in the six months to December 2011, but Sensis revenues plummeted 24 percent in 12 months.

read more

Compiling and contributing to the Linux/open source subversion

Opinion and Analysis

You can download the latest SVN client, which at the time of writing is v1.4.5, from Tigris.org. It is available in source code format, requiring compiling, or pre-compiled binaries for a variety of Linux distros as well as Microsoft Windows.

SVN is a command-line system (although GUI front-ends can be found) and has pretty much just one command, namely svn. The very first svn parameter you should master is checkout. This will download the entire source tree from the specified repository.
In the case of WordPress, their Subversion repository is hosted at svn.automattic.com/wordpress/trunk so the appropriate command is

svn checkout http://svn.automattic.com/wordpress/trunk

This invokes the svn command, instructing it to check out the whole repository at the URL given.
This only needs to be run once; once you have the repository the command to use hereon in is
svn update

This command is deceptively simple. It goes through your local copy of the repository as well as the master copy back on the server. It uploads any modifications you have made back to the server, and it downloads any modifications others have made to your copy. Where possible, if two or more people – including yourself – have modified the same file then changes will be merged so long as they don’t interfere with each other.

If you only want to build the latest version of an app, then these are the two commands you need; run svn update regularly and you’ll always be up-to-date.

If you’re contributing to a project, be sure to run svn update before you begin coding just to make sure your repository is current. This will help minimise any version conflicts which can occur if two people do edit the same section (and which require a bit of manual work to rectify.)

When you’ve finished working, don’t perform an update straight away; run svn status to confirm what you have actually done. This causes SVN to run through the project and advise you every file you have modified – and which it would upload if you updated – as well as any files that may be in a conflicting state.

You might find that you have inadvertently modified a file that you didn’t mean to, or no longer wish to. You may see that someone else has implemented a change you were working on and no longer need to.

The svn status command will show the names of files; to see more information – the actual lines of code themselves – run svn diff. This produces output showing how your files vary from the original versions you began with.

If you determine you wish to undo a change, you use the svn revert command followed by the name of file you want to send back to its original state – e.g. svn revert main.c.

Now you can update!

That’s the fundamentals of Subversion. If you’ve made it this far, you’re a Subversion champion. You have all the tools and commands and concepts under your belt to retrieve all the SVN repositories you crave.

There’s a lot more to version control however; there are many advanced things you can do like even branching one project into two different directions – and then bringing them back together again. As indicated earlier, you can review the version history for files. There’s a lot of power at your fingertips through the tiny three-letter svn command.

There’s a great book available online, for free, which goes through SVN in great detail and is well recommended.

Loading comments ...



- sponsored feature -

The Death of Traditional BI: What’s Next?

How to Make Business Discovery Work for Your Business IP PABX BUYING GUIDE

Business Discovery takes its cues from consumer apps. Like Google, it encourages us- ers to hunt for and explore data without worrying about or even noticing the underly- ing technology. Their entire experience is working within an intuitive interface to get real-time, self-service results with only minimal training. ...more