How to swarm some code

As if a “how does one make such a code swarm?” comment was not to be anticipated….

First of all you’ll need codeswarm in order to use it you’ll also need sun-java6-jdk (or whatever your distro might call it) and ant. (on Kubuntu I recommend you install without recommends though)

Now it gets tricky. You’ll need to get a log from your version control system and convert that using the script in convert_logs. If you are using bzr you are boned since the script does not parse the default log output of bzr, neither is a plugin available for bzr that would output something the script can handle (or directly to the XML format as produced by the converter script)… if anyone wants to create one… 🙂
So, if you are using bzr it’s probably best to convert to something supported (beware bzr fast-export|git fast-import is broken if you have tags that include :, such as used to mark an epoch in debian packaging). I used hg (aka Mercurial) since it got a halfway decent converter plugin that converts from about everything to hg (also you get additional goody magic, see below).

Now just take a look at the data directory and tweak stuff to your needs. Execute and you should get a live swarm in a window.
If you set


in the config you will get loads of png files, those you can abuse to render a video (with mencoder for example).

If you want it a bit more automized…
With that fancy script you bascially just need one config fie with loads of hg convert lines, then run script and you’ll end up with a ready to go rendered avi file.
The config might look like this:

`–> cat simple.config

banshee: hg convert /home/me/src/git/banshee banshee

amarok: hg convert /home/me/src/git/amarok amarok

It executes the given command and hopes to end up with a directory named like the entry, then gets an hg log from that, parses it, combines it with the other entries in the config to end up with a shared codeswarm. Then it just executes the codeswarm app with an autogenerated config, mencodes the resulting pngs and plays that back in mplayer.

I hope you understand that I don’t give a step to step tutorial, the documentation is all there and….one remark: Since codeswarm is javaware and community_codeswarm is pyware you are going to have to do fiddling to get it work properly 😛

Have fun swarming 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s