Monday, September 17, 2007

Five Years

That's not quite how long it took Glyph to write a post explaining what he meant when he told me that xUnit should use the visitor pattern instead of the composite pattern.

I'm going to write a more detailed response later, God willing. I just wanted to flag the post and say thanks to Glyph for finally posting it — the hassling must have worked.

Labels:

Monday, September 10, 2007

It's a Gibbon

Over the weekend I upgraded my laptop to Ubuntu 7.10 aka "The Gutsy Gibbon".

Obvious improvements include having Pidgin installed and a much superior version of Deskbar. There's also a swanky new panel to actually control display settings (dual monitor and all that jazz). Unfortunately, I can't quite get it to work just yet. My 22" 1680x1058 LCD will just have to sit there, gathering dust :(

In another weirdness, all of my fonts are suddenly much, much bigger. I had to resize everything down to 8 or 9 to make them sane.

My pretty Emacs has also stopped working, but that's to be expected. It's a third-party package that hasn't yet been built for Gutsy.

Other than that, seems to be a fairly routine upgrade. Is there anything exciting that I've missed?

Labels:

Wednesday, September 5, 2007

Merging New trunk Features to a Development Branch (redux)

Oubiwann has recently posted about the joys of using Combinator to do branch-based development using Subversion. I thought it'd be fun to do the same post, except this time with Bazaar.

Background


You're working on a project called "Project", you have a copy of the mainline branch (i.e. 'trunk') in your src directory.

~$ cd ~/src/Project
~/src/Project$ ls
trunk

You want to implement a new feature, so you branch trunk to work on it:

~/src/Project$ bzr branch trunk viking-feature-836

Bazaar is a version control system, not a PYTHONPATH-managing system, so it doesn't maintain a global list of projects and the branches that are currently active for each project.

Perhaps your company focuses on historical invasions of Britain. You decide to start work on another feature:
lass objects.

~/src/Project$ bzr branch trunk norman-feature-1066

You multi-task for a bit, until you finish 'viking-feature'. You decide to merge 'viking-feature-836' into trunk.

~/src/Project$ cd trunk
~/src/Project/trunk$ bzr merge ../viking-feature-836
~/src/Project/trunk$ bzr ci

At this point, you begin to suspect that Bazaar treats branches as first-class objects. However, at this point, a developer on the obverse side of your continent calls you,

"Where's your viking feature? I need it to invade Britain!"

"I've just put it into trunk. Have you got the latest copy?"

"Yeah, I do, I just pulled from trunk."

"It's in trunk, you fool! ... Oh, wait, gimme a sec."

~/src/Project/trunk$ bzr push
Pushing to bzr+ssh://bzr.example.com/Project/trunk...
~/src/Project/trunk$

"Try now."

Merging


OK, enough background, let's merge.

Say you need some of the changes in trunk in order to finish work on your norman feature. No problems.

~/src/Project$ bzr merge trunk norman-feature-1066
~/src/Project$ bzr ci -m "Merge from trunk."

It's hard not to feel smug at this point.

Wait a second, you also want to look at the experimental branch that a friend is working on:

~/src/Project/norman-feature-1066$ bzr merge bzr+ssh://yourfriend.example.com/branches/sealion-1946
~/src/Project/norman-feature-1066$ bzr diff | less # better double check this one
~/src/Project/norman-feature-1066$ bzr revert # nope, doesn't seem like a good idea

Summary


Bazaar treats branches as first-class objects and treats trunk just like any other branch. Although Combinator is great for branch-based development in Subversion, it is more complex and less flexible than doing branch-based development in Bazaar.

With Combinator, you lose history when you merge in changes from trunk, with Bazaar you don't.

With Combinator, you can only merge in changes from trunk, with Bazaar you can merge from any branch.

With Combinator, merging from trunk leaves a bunch of changed files in the trunk checkout on your system (this has tripped me up more than once). With Bazaar, this doesn't happen.

Labels: