Top Ten (Mercurial) Commands

Since Mercurial took top spot in the top ten commands post, I though it might be interesting to take a look at the break down of which Mercurial sub-commands I end up using:

aaron@ares ~$ history | grep hg | awk '{print $3}' | sort | uniq -c | sort -rn | head
  97 st
  21 commit
  20 push
  14 addremove
   8 diff
   7 qrefresh
   4 qnew
   4 qfinish
   3 up
   3 revert

hg st takes the top spot, indicating that "What the hell have I changed?" is a pretty important question to have answered. The fact that hg commit and hg push are at the top while hg pull is nowhere to be seen is a bit of an anomaly due to the fact that I'm the only one working on the repositories in question. I would expect the results to be very different if you did the same experiment on my work machine. The hg q* are all commands that are part of the Mercurial Queues extension that I use for shaping my changesets and rewriting history.

Extensions

I make pretty heavy use of both the Mercurial Queues and Rebase extensions. In tandem, they give me the ability to make my changesets to be exactly what I want them to be and to move my local branches to tip before I push (which I use so that I don't have to add trivial merge changesets). My workflow has a tendecy to look like this:

$ # do work
$ hg qnew -f -m "A pithy commit message bugzid: 1234567" a_patch.diff
$ hg qpush -a
applying first.diff
now at: first.diff
$ hg pull --rebase
pulling from /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ hg qpop
popping first.diff
now at: a_patch.diff
$ hg qfinish -a
$ hg push
pushing to /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ hg qpush
applying first.diff
now at: first.diff
$ # do more work
$ hg qrefresh
$ hg pull --rebase
pulling from /a/repository
searching for changes
no changes found
$ hg qfinish -a
$ hg push
pushing to /a/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files

Sure, I could live in the world of hg fetch and type fewer commands, but I feel like having nice atomic changesets, commit messages without typos and a nice clean history is worth the extra typing.