Monthly Archives for April 2008
28
APR
As UK iPhone users will know, we still don’t have a nice & easy way to create ringtones of our iTunes Music. To me this seems a little unfair, especially considering how absolutely rubbish the default ringtones on the phone are.

So after hearing “Strum” one too many times I decided to create a few ringtones based on TV & film themes to pop onto my iPhone and I now I have the ‘Grandstand’ theme as my ringtone – woo!
To say all that and not publish my the fruits of my labour would be just mean, so I’ve zipped up 13 files for the following TV shows/films.
- Countdown
- Fame Academy
- Grandstand
- James Bond – big
- James Bond – original
- Matrix
- National Lottery Balls
- Play your cards right
- Radio 1 Newsbeat
- Strictly Dance Fever
- The Apprentice
- The Bill
- X Factor
To install these onto your iPhone simply open up iTunes and drag the files into your ‘Ringtones’ page.
Download Pack 1 (5MB, ZIP compressed file)
15
APR
Enjoying your SVN Time
Posted by Adam Posted in Software 4 comments
Since moving from my Windows PC to my Mac last year, I’ve always have the problem of managing anything with Subversion. In Windows, I had the luxury of the fantastic TortoiseSVN which handled every SVN need I had however on the Mac there is no such software. OK, RapidSVN and svnX try to be good clients, but they simply don’t live up to the high standards set by the TortoiseSVN guys.

So, I had to decide – do I really want to boot up a Parallels install each time I want to commit or update my code? Of course I don’t, so I started playing with the plain old SVN command line. Although, I’ve always used it for quick checkouts, exports, commits and updates I’d never used it for managing a large project where files get added, deleted & moved around on a regular basis so it was time to use it mainstream!
I thought I’d post up a very quick entry about what things I use and how it’s so easy once you get the hang of it.
The two most useful commands during your project’s life cycle will be svn up and svn ci which will update and commit your code respectively.
Update your code before committing
I strongly advise always running an update before a commit – this will ensure that code you commit is at the latest version stored in your repository. It will update your local code to match that in your repo and merge (as best it can) your changes with those which have been committed since your last update.
When you run svn up (from within your working copy), you will be presented with a complete list of all the files which have been updated and each file will be prefixed with a letter – A (added), M (modified), D (deleted) or C (conflicted) are the most common.
Once complete, you should check this list for any files which have conflicted – this means SVN couldn’t work out how to automatically merge the changes it downloaded with those on your local machine and you need to merge them yourself. If you browse to the folder where the file with the conflict exists, you will see 3 extra files – filename.r24, filename.r26 and filename.mine – these files represent the version which matches your working copy revision, the latest in the repository and the copy you have. It is now completely upto you to make sure your local copy, includes all the changes which others may have made using these newly created files as a point of reference.
When you’re happy with your merge, simply type svn resolved path/to/filename to remove the extra files thus marking the file as resolved.
(Rails App Tip: if your developing a Rails application, I advise you to now also run an rake db:migrate to update your database schema.)
Committing your code
Now you’re all up-to-date you can send all your updates to the server. But… wait… you need to check something first!
To check what changes your about to commit simply run svn status (inside your working copy). This will return a list of files similar to that provided by the update command and, as before, each of these will also be prefixed with a letter – A (newly added), M (modified), D (deleted) and ? (not added yet, but in the working copy). As above, you don’t need to worry about A, D and M – SVN knows what it’s going to do with these however, you do need to keep an eye on ?.

The question mark (?) means that you have put a new file in your working copy but it hasn’t been properly added to SVN. To add these files you need to run svn add path/to/new_filename – this will add it and any new output from the status command will show an A rather than a ?.
If you have lots of these files, you can use the useful command below to simply add every file marked with a ? – this is a real time saver if you’ve just added a folder of images or copied in files from another folder.
svn add `svn status | grep "\?" | awk '{ print $2; }'`
Once, you’re happy with the output from svn status, you can proceed to actually commit the changes by running svn ci. When you run this command, your default text editor will open and ask you to enter a commit message – this should outline all the changes you made in this revision – it’s useful to make this as detailed as possible but don’t spend too much time on it.

In summary
This post only covers the very basics of Subversion – there is so much more – svn revert, svn diff and lots of other useful commands which you’ll need to learn if you want to switch all your SVN usage to the command line.
If your sitting there angry with your SVN client app – don’t be scared to explore the wonderful world of the command line. It’s nowhere near as scary as it’s made out to be.
But… please, please, please take a full backup before exploring any new things!
Other resources
The SVN Book is free to download – have a look.
Why not take a look at this basic work cycle for a little more info about the commands available to you.
If you have any questions, please don’t hesitate to post a comment.