Draconis Software Blog

Pulling Subversion Logs for a Single User

There are many times during a project where I use the svn log command in order to see what has changed and to get a feel for the pace of development. It's also great when you're dealing with clients; you're only one command away from telling an inquisitive client exactly who did what task and when they did them. However, svn log is missing one important feature -- the ability to filter by a particular username. When I asked in #svn on freenode, they suggested I use the --xml option and parse the resulting output.

The following is what I came up with. It's a ruby script that uses the delightful Hpricot gem to parse the xml. It takes one argument, the subversion username that you wish to retrieve the logs for. I hope that it's useful for someone else! You can curl it from http://pastie.textmate.org/197763.txt if that makes it easier, too.

RUBY:
  1. #!/usr/bin/ruby
  2. require 'rubygems'
  3. require 'hpricot'
  4.  
  5. username = ARGV[0]
  6. if username.nil? || username == ""
  7.   puts "Please specify the username to cull log entries for."
  8.   exit
  9. end
  10.  
  11. puts "Requesting SVN log, this may take a bit."
  12.  
  13. doc = IO.popen("svn log --xml") do |f|
  14.   Hpricot.XML(f)
  15. end
  16.  
  17. entries = doc.search("logentry").find_all do |entry|
  18.   (entry/"author").innerHTML == username
  19. end
  20.  
  21. entries.each do |entry|
  22.   revision = entry.attributes["revision"]
  23.   author = (entry/"author").innerHTML
  24.   date = (entry/"date").innerHTML
  25.   msg = (entry/"msg").innerHTML
  26.  
  27.   puts "r#{revision} - #{author}"
  28.   puts "#{date}"
  29.   puts "#{msg}"
  30.   puts "-"*80
  31. end

Linux 2.6.22 Released

LinuxThe latest and greatest Linux kernel (2.6.22) has just been released. Of the numerous interesting new features, I'm especially excited about two things: a new way to measure approximately how much memory a process is using (via the process footprint measurement facility), and the ability to measure file timestamps using nanoseconds for greater precision.

In addition, there's a new wireless stack, a new Firewire stack (very cool), and a slew of new drivers and other changes. Check out details about this release here, then download the kernel. Enjoy!

New MacBook Pros

15inch MacBook ProThere's a great, in-depth review (via Engadget) of the new MacBook Pro 15inch, which was released just a few days ago. The reviewer notes "I'm new to Mac computers, new to OS X, but I am one happy switcher", which echoes a sentiment I had not too long ago.

One of the big new features is the introduction of the LED back-lit screen:

LED back-lighting is touted to provide a more evenly lit screen with sharper images and colors without sacrificing battery life. All these I find to be true, the screen is without a doubt the best i've ever seen on a laptop, and better than a lot of desktop monitors I use. With the brightness up to full, even in the most well lit rooms, solid whites are almost blinding, which allows you to turn down the brightness and use less battery.

I was originally a Mac guy, switched to Linux as my desktop du jour, and then switched back with the MacBook, and I'm very glad I did.

Cool Mac App: stattoo

For you Mac users out there, there's a cool app I recently stumbled across called stattoo, by Panic Software. It's a simple little app that adds mini apps to your desktop to show interesting information (i.e. weather, latest email, upcoming appointments, etc). It's a little faster than using the Dashboard, looks wonderful, and unobtrusive enough not to interfere with other things you're doing.

Give it a try. It costs a couple bucks if you like it, and so far I've been very impressed.

Installing Subversion on MacOS

Recently, I needed to upgrade the Subversion client I had installed on my Mac (my personal development machine) to a more recent version. The issue that came up was an incompatibility between my IDE’s Subversion plugin and the command-line version I had previously installed.

When checking out files within the IDE (or even doing updates, for that matter), the sandbox would have its version flags switched, causing my command-line client to no longer work. It got frustrating, as different parts of the sandbox were done in different editors (a Java IDE for one project, a text editor for another, etc), and keeping my sandbox up-to-date was proving tedious.

So, the solution was to update the Subversion client on the command line. Doing so was very easy, though it required building from source (I haven’t been able to find a recent binary installer for the Mac).

(Read the article)

Updated to Ubuntu 7 (Feisty Fawn)

Ubuntu LogoYesterday, we updated our workgroup server to the latest version of Ubuntu - Feisty Fawn - and so far we've been happy with it. We're a little late in updating, though that was primarily us being careful on a production machine. The main reason for updating, actually, was due to an issue with PHP.

We've been doing some work in PHP lately that makes use of the GD library to do some interesting graphics manipulations. One of the components of the project made use of a transparency color for an image resource, and it seemed like there may have been a bug in the imagefill function: filling with a color of -1 caused the php processor to segfault. What was odd, was a different version (on my Mac), wasn't crashing at all. This prompted the update to the latest Ubuntu. The latest version, 5.2.1, solved the problem and we were good to go.

Doing an Update (from Edgy to Feisty):
A distribution upgrade with Ubuntu is cake: simply edit your /etc/apt/sources.list file and replace "edgy" with "feisty". Next, update the sources list (apt-get update will do it), and finally do a dist-upgrade (apt-get dist-upgrade). Check out this article for more details, as well as how to do a dist-upgrade using the GUI.

Red Hat Enterprise Linux 5 Released

RHEL 5 has just been released today, and has a number of interesting new features (here's the announcement). The main focus of the release has been around virtualization and security, as well as doing away with the ES, WS, and AS monikers, replacing them with more generic (and less confusing) terms such as RHEL Advanced, Desktop, etc. Coming 2 years off the last release, I think RHEL is due for an upgrade.

Check it out. Though we don’t use RHEL on our production machines, a number of large IT departments do. Be sure to post your reactions here.