Thinking Subversion

Since I had to clean up all the mess in my SVN repo today, I’d like to show you some nifty tricks ;) First of all, I encourage all Windows users to forget about TortoiseSVN and all the other GUI versions, cause there’s nothing better than the good old plain-console subversion client. Just add it to your %PATH% system variable and you’ll be able to use svn commands from anywhere in the Windows command line.

Okay, cleaning up. During any cleanups and reordering subversion repos you’ll encounter with moving, renaming and deleting files. And here’s my favourite South Park phrase – “Just don’t mess up okay? You’re messing up too much!”. Do NOT delete, rename or move files thourgh your Windows explorer. The right way to do it is using SVN commands:

svn rename oldfile.php newfile.php
svn move oldfolderfile.php newfolderfile.php
svn remove unwantedfile.php

Yes, and the file will be removed/renamed/moved on your local working copy, then in the repo after you commit changes. Anyways, if you do mess up, you can always throw everything to your trashcan and start over with a fresh checkout (I’ve got a lot of temp folders full of these ;).

And of course property setting (propset) and removing (propdel) when it comes to svn:ignore properties. Properties in SVN are applied to the directory you pick and will not apply to its subdirectories, so be careful. Here’s how you set the svn:ignore property (for filename.php) on a folder:

svn propset svn:ignore "filename.php" folder

And here’s how you remove it:

svn propdel svn:ignore folder

That’s about all I had to say. Oh and don’t forget to cleanup sometimes:

svn cleanup

And since I’m a NetBeans fan, I just have to say that NetBeans IDE is just great when it comes to version control. It supports both CVS and SVN repos and it’s real quick at getting the job done if you split up your sources into NetBeans projects. It has an in-built repo browser, diff viewer and others. And it’s just a one-click-view-changes-and-commit ;) I love it. Go get yours: netbeans.org.

NetBeans IDE 6.5 RC2

I’ve finally got a chance to run the new NetBeans IDE (I’m talking about the “Early Access for PHP” version).

I’ve been running 6.1 ea-php for quite some time now. I haven’t had problems with 6.1 on my Fedora 9, but my Windows XP distro sucked at running NetBeans 6.1, and that’s bad cause I have to use Windows at work. I’ve been experiencing problems with character encoding, the cp1251 vs utf8 battle, syntax highlighting (especially when it came to CSS) and the IDE could hang once every 2 hours or so.

Anyways, I’ve switched to NetBeans 6.5. RC2 today and haven’t had any problems yet. Some new features in NetBeans 6.5 include the Web Services section in the Services tab, that helps you work with services like Amazon, Google, Flickr, Facebook and others. Very helpful indeed. They’ve also put support for some other database drivers – PostgreSQL and JDBC/ODBC along with good old MySQL.

Pick your own version of the IDE in the NetBeans download section.