subversion

God, Windows is sloooooow

I am assisting a colleague today check out a rather large feature branch. I showed him the branch address and he started checking it out using Tortoise SVN on Windows 7.

Upon returning to my desk (Ubuntu 11.10), I decided to merge the branch with the major trunk. I checked out a brand new copy of the branch, merged it (for the first time in several months) and then re-committed the pages.

Guess what, he’s still checking out the original!!!

Do yourselves a favour guys, make it Linux this Christmas…

SVN Externals – how to add them

When creating a Zend Framework site, its always best to keep the Zend library as an external source. This way you can keep the branch up-to-date with the release of Zend with a simple text file.

To access the externals file, navigate to the root of your site:

> cd /var/www/mysite

And add the external to the svn:externals file. I am using the latest version of Zend Framework for this, but you can use any SVN source you like. Note, it has to be available as an SVN repository.

> svn propedit svn:externals .

This will open a text editor.

To enter an external, just enter the local folder to download to, and the source SVN.

destination source

So, if I want my Zend Framework files to be saved in /var/www/mysite/library/Zend :

library/Zend http://framework.zend.com/svn/framework/standard/tags/release-1.11.9/library/Zend/

The first part is the local, second part is the URL of the repository.

Save and close.

Next time you do an update, svn will go and fetch the external files and save them for you.

Other externals are available, such as JQuery, various wikis and other JS sources.

 

 

 

Ubuntu Console commands for SVN

Console commands in Ubuntu for use with subversion

Checkout a branch:

svn checkout url@revision path

To update your local source:

svn up

And to commit a single file:

svn ci -m "message for commit" <files>

Multiple committing is just without the <files>.

To download a revision

svn co -r 1671<remotefolder> <localfolder>
<remotefolder> could be any folder in the svn structure, i.e.
http://www.mydomain.com/svn/project/trunk/folder

Getting a list of revisions for a page (if you’re trying to find when you changed a page)

svn log -g <files>

Merging a branch into another

svn merge http://svn.branch.url localfolder .

That will merge the specified url into the localfolder. Ensure that your local changes in your working copy have been committed before you do this.