Bunch of little things

Here are a bunch of little features I needed for my upcoming Mercurial workshop. Let me know if a single pull request for all of them is problematic, so that I can split it up into one PR per bookmark (or branch ref, in gitspeak).