Cherry pick and merge revisions in Mercurial

I’ve mentioned before that I prefer Mercurial to Git, at least for my own work. That said, git has a nice feature that allows you to cherry pick revisions to merge between branches. That’s extremely useful if you want to move a single change between branches and not do a full branch merge. Turns out mercurial has that ability, too, but it goes by a slightly different name.

There are actually two options in Mercurial – the older transplant extension and from Mercurial 2.0 onwards, the built-in graft command. I prefer to use the graft command, mainly because it is built into base mercurial and thus is available everywhere as long as one is running Mercurial 2.0 or up. Given that the current release is 4.0.1 as of the time of writing, you should really run something newer than 2.0. Also, graft uses mercurial’s merge abilities to cherry pick the change, you have a somewhat better chance of the change applying cleanly. Transplant uses the patch mechanism with works reasonably well, but in my opinion the merge system works better especially if you’re dealing with something that turns into a three way merge.

Usage is pretty simple – switch to the branch that you want to graft a change onto (the destination branch) and then graft away using the revision number of the change you want to use. Say, you want to graft a change 9534 to the release_356 branch:

hg co release_356
hg graft 9534

Note that hg graft does a merge and commit of the specific revision in one step as long as you don’t encounter a merge conflict. If you do encounter a merge conflict you’ll have to resolve it like you would resolve any other merge conflict, followed by a manual commit.

hg graft has additional functionality over and above simple cherry picking of one revision. For example, you can graft a range of revisions onto another branch. Have look at the documentation for hg graft for more information.

Mutt regex pattern modifiers

I still use the mutt email client when I’m remoted into some of my FreeBSD servers. It might not be the most eye pleasing email client ever, but it’s powerful, lightweight and fast.

Mutt has a very powerful feature that allows you to tag messages via regular expressions. It has a couple of special pattern modifiers that allow you to apply the regex to certain mail headers only. I can never remember so I’m starting a list of the ones I tend to use most in the hope that I’ll either remember them eventually or can refer back to this post. The full documentation can be found here, so this is only a cheat sheet that reflects my personal usage of the mutt regex pattern modifiers.

~f – match from
~t – match to
~c – match cc
~C – match to or cc
~e – match sender
~s – match subject

What happened to XEmacs?

I used XEmacs quite a lot in the 2000s before I switched back to the more stable GNU Emacs. That was back then before GNU Emacs offered a stable official Windows build when XEmacs did, and at the time I was doing a lot of development on Windows.

Out of curiosity and for some research I tried to look into the current state of the project and found that the www.xemacs.org appears to be unreachable. The domain still exists and according to whois was last updated in September 2015. The XEmacs Sourceforge page is still around, but appears to have received its last set of updates in 2009. Obviously a lot of links to the bug tracker, mailing list hosts etc are dead as they’re point to subdomains of xemacs.org.

Anybody know what happened to the project? The only reference I found was a post from January 2016 on a website I’ve never heard of (8ch.net) referencing a post on the XEmacs development that I can’t get at anymore (becauses lists.xemacs.org is dead) that suggests XEmacs development is officially dead now.

Picture showing "About This Mac" after I upgraded the CPU

Bit the bullet and upgraded my Mac Pro’s CPU

I’ve been an unashamed fan of the old “cheese grater” Mac Pro due to its sturdiness and expandability. Yes, they’re not the most elegant bit of kit out there but they are well built. And most importantly for me, they are expandable by plugging things inside the case, not by creating a Gordian Knot of hubs, Thunderbolt cables, USB cables and stacks of external disks all evenly scattered around a trash can. Oh, and they’re designed to go under a desk. Where mine happens to live, right next to my dual boot Linux/Windows development box.

Read More