Unwind with Subversion

16 October 2007

codehaus jbossorg opensource ruby subversion tools

At the Codehaus and at JBoss.org, I've continually come across Subversion repositories that needed to be split apart or merged, perhaps after converting from CVS. One problem you continually hit, particularly if you're merging repositories, is the "date order of revisions" bug. Simply stated, if you create a new repository loaded from two other repositories, you can end up with a situation where revision N does not necessarily occur before revision N+1, in terms of the commit time-stamp.

When you do a date-based operation using Subversion, it does a binary search through the revision sequence to find the revisions matching the specified dates. This binary search assumes the revisions are indeed date-ordered.

With the acquisition of Mobicents by JBoss, we're in the situation of having to merge about a dozen repositories. Some are CVS, some are SVN. Good ol' cvs2svn works well for the first step, of converting a CVS repository into a SVN repository. But now we have either oddly disjoint repositories, or conflicting paths overlaid one another.

I've always been a fan of mod_rewrite for Apache-httpd, and a SVN dumpfile has a lot of paths just ripe for rewriting. 1000 lines of Ruby code later, I'm able to announce Unwind. Unwind is a Ruby library, along with a command-line tool, for performing mind-numbing feats of repository surgery.

Since a massive conversion and rewriting is something that requires a bit of trial-and-error, the command-line utility is ultimately driven by a configuration file. Of course, with Ruby, it's just a DSL created using instance_eval and blocks.

Picture 5.png

This configuration file will ultimate produce a single file (merged-repo.svndump) from multiple input dump files. Each source file can include()/exclude paths (based upon the original paths in that particular dumpfile). Each source can also use Rails-ish URL rewriting. The :something syntax matches 1 segment of a path, and is available as a substitution value in the output path for the rule.

The rewrite engine tracks all existing paths, and creates parent directories when necessary. SVN copy operations are fully adjusted both for the source and the destination paths.

Unwind automatically interleaves revisions to achieve total monotonically increasing time-ordering for the final repository.

Finally, before a revision is emitted to the output repository, addition include()/exclude() rules can be applied. For repositories converted from CVS, you may end up with a bundle of CVSROOT directories attempting to live in the same location. No reason to rewrite them to unique locations, as you can just exclude them before they get figured into the final output repository.

Unwind uses SQLite for organizing the meta-information about each repository and revision, while performing random-access seeks on the source dumpfiles to produce the final repository. While merging may be the common use-case, Unwind's rewriting also makes it useful just for extracting bits out of a repository.

At this point, this blog entry is the complete documentation for Unwind. But feel free to browse the SVN repository.

Mashup Down Under

01 August 2007

business java tools

Picture 13.pngMike "JIRA JIRA JIRA" Cannon-Brookes pinged me on IM tonight to let me know that Atlassian has acquired Cenqua. Cenqua, as you might know, makes the fancy-dandy FishEye product for viewing source repositories. Atlassian is the Australian wiki/bug-tracking giant run by stylish surfers.

Congrats to both groups. I enjoyed having beers with the Cenqua kids at JavaOne this year.

Yard Blog

23 July 2007

asheville photography tools yard

Rebecca and I have a habit of standing around, talking about all the things we could do to our house.

Some of our talk has centered around the ugly "patio" of poorly-laid bricks and easy-to-trip-over landscaping timbers.

removal.jpg spike.jpg This morning it was a brisk 65 degrees, perfect for some manual labor, so up came the patio.

Thankfully the people who laid these bricks previously had indulged in quite a bit of sand, so I only need to screen it before laying everything back down, hopefully better than it was before.

One of the best tools ever is a 6-foot-long tempered steel spike with a cutting edge. Great for removing stumps or prying up landscaping timbers.


I've also found that I enjoy yardwork as a nice form of exercise, instead of doing something pointless, like lifting a weight 50 times, or walking around in a large circle.


Which looks right?

06 July 2007

tools usability web-20

Was signing up to try Remember The Milk, and thought the way they figure out your date-formatting preference was pretty smooth.

Picture 6.png

Well, that's pretty darn simple.

Silent Paint Remover

05 April 2007

technology tools

Picture 28.pngToday, the Man In Brown showed up, and dropped off some boxes.

They were for my wife. Damn!

Then he came back! And brought a box for me. Inside the box there was some flavorless edible packing peanuts (they dissolved amazingly quickly in your mouth) protecting a Silent Paint Remover.

This thing rocks!

I live in an 82-year-old house, which means it's seen 82-years worth of styles come and go. That's a lot of paint. Our shoe molding is all rounded over due to the many layers of lead, latex and who knows what else.

Point it at the shoe molding for 60 seconds and then give a good scrape. Truly amazing.

While the heating device itself is silent, the squeals coming from the scraper as 82 years of sea-foam green, buttermilk, white and teal come peeling off the wall are reminiscent of dragging a pair of cats across a chalkboard.

From reading online, the amazingness of the product made me suspect there was a high probability it could be a RonCo-esque product and a waste of money. Though, it probably can be used to cook a turkey nicely.

But then I found this guy, who explained the science and even provided a how-to about making one for yourself. I promptly set out to find the required space-heater of the appropriate type.

I quickly learned that asking the Helpful Friendly People at Lowe's and Home Depot for space-heaters while you are wearing shorts and a t-shirt is a fantastic way to survey how different people express "what kind of nut are you?" with only their eyebrows.

Apparently space-heaters are a seasonal item, and April isn't the season for them.

Due to the lack of parts to build my own, I punted and just bought the pre-made version. Tonight, with minimal effort, I stripped 8' of base boards in about a half hour. Without any chemical burns or heavy metal poisoning.

I'd consider that a success.

Desk Flossing

13 March 2007

health lifehack tools

Floss! Just a quick lifehack that I've started recently, completely unintentionally.

I picked up a huge bag of DenTek Easy Angle(tm) Floss Picks ("Flossing Made Easy!") and keep them at my desk.

I previously thought I hated flossing. Now I've realized that I simply didn't like wrapping thin string around my fingers until they turned blue. The Floss Picks are nice.

The key is to use them when you're stuck on a long, mute-friendly conference call. It helps if you have a headset. Sure, you could surf the web or try to be productive, but you'll miss someone important say something even more important at just the wrong time if you let your attention wander too much. Flossing, on the other hand, is an activity that doesn't require you to take too much attention away from the call. Unlike trimming your finger and/or toe nails, flossing is a relatively quiet sport, suitable for cubicle dwellers.

I've flossed more in the past week than I had in years.

Give it a whirl. And don't forget to hit mute.

Boxy To Go

05 December 2006

culture opensource osx tools

Picture 11.pngBeing an OSX user, I've felt massive amounts of unlove from TiVo, in terms of the TiVoDesktop, TiVoToGo, etc. But now, man, the guys behind tivodecode have come to my rescue. While playing with it, I also discovered that the TiVo actually produces a nice XML feed, and mine at least attempts to serve up some RSS (but it ultimately fails).

tivodecode spews out MPEG-2, which QuickTime can't handle natively. You can spend $19.99 at the Apple Store to get the MPEG codec pack, or use DarwinPorts to install MPlayer, which handles MPEG-2 just fine. For free.

Bless all those opensouce geeks out there in the world. Bless each and every one of you.

Google Refinement

06 October 2006

google technology tools

Picture 42.png New feature?

Update: No, not a new feature. A quick googling resulted in at least a sighting back in April. This seems to be a feature specific to medical terms.

100% Pure Ruby(tm)

26 September 2006

day-job java ruby technology tools

Picture 34.pngRecently I've been doing a fair amount of work in Ruby. And yes, I've felt super-productive. Particularly compared to Java.

The downside of working in Java is the 100% Pure Java(tm) mentality. In the search for a clean and cohesive system, we take the attitude that if it's not pure Java, it's crap. In Java, if we need something to happen periodically, we might examine TimerTask, decide it's insufficient and move on to Quartz. So we add it to our build, figure out the API, realize it conflicts with some other dependency. Well, damn.

With Ruby, it's scripty enough to not feel the need to have a 100% Pure Ruby(tm) mentality. A Ruby system needs something to occur periodically, we just open a pipe to crontab and hand that bit off to cron.

"But Windows doesn't have cron!"

Too bad.

Use a better operating system.

The majority of systems deploy to Linux or some other Unix-alike. Developing on a Unix-ish system only makes sense. You wouldn't prepare to drive an RV by tooling around in a Kia Sportage, now would you?

When you break free of the JVM mentality and assume a sensible host operating system, you realize that the OS itself is your virtual machine to play in. If it's in your $PATH and can be expected to behave reasonably well on any sane Unix-like OS, by all means, use it.

Back to the premise... Since Ruby is indeed "scripty" you can accomplish a crapload just using a pair of backticks, effectively not even using Ruby at all.

And you can do it without guilt or complication. Completely unlike punting to Runtime.exec(...). That always makes you feel dirty.

Perhaps Groovy and JRuby will help break the never-escape-the-JVM attitude. Give a developer backticks and easy pipes to subprocesses, and no telling what sort of nefarious things he might could do.

Smoking like a Chimney

16 August 2006

food tools

Continuing the trend of physical-world things you can buy at Lowe's, I'd like to sing the praise of the charcoal chimney.

This summer, I decided to start grilling with actual chunks-of-wood charcoal, instead of pressed-and-formed McCharcoal Briquettes (now made with all white meat). Real charcoal does not include the mass-load of volatile organic compounds that the "match-light" briquettes have. I started by dousing it with liberal amounts of charcoal starter fluid, and whoosh, I'd eventually get an uneven grilling bed.

After picking up a few copies of Cook's Illustrated (check out July's centerfold), I learned of the charcoal chimney. A few sheets of newspaper or discarded resumes you got from some goons on Craigslist, and your charcoal is evenly nice and toasty within 20 minutes. It's a beautiful and simple design. I have no idea why I never tried one sooner.