Quickly Show Changeset Information

posted by Steve Losh on September 29, 2009

Mercurial has a couple of commands to view information about changesets, but if you find yourself reviewing individual commits often you can add the following alias to your ~/.hgrc file:

show = log --color=always -pr

Note: If you’re using a version of Mercurial older than 1.3, you’ll need to enable the alias extension first, or preferably update Mercurial.

Now you can use hg show REV to view the details of and changes made by a particular revision, like this:

$ hg show tip
changeset:   34:386adf7273a8
tag:         tip
user:        Steve Losh <steve@stevelosh.com>
date:        Mon Sep 28 22:16:10 2009 -0400
summary:     Switch the feed link in the navigation to use FB too.

diff --git a/layout/skeleton/_base.html b/layout/skeleton/_base.html
--- a/layout/skeleton/_base.html
+++ b/layout/skeleton/_base.html
@@ -53,7 +53,7 @@
                 <a href="/tips/beginner/">beginner</a> /
                 <a href="/tips/advanced/">advanced</a> &mdash;
                 <a href="/submit/">submit</a> &mdash;
-                <a href="/tips/atom.xml">feed</a> &mdash;
+                <a href="http://feeds.feedburner.com/hgtip/">feed</a> &mdash;
                 <a href="http://twitter.com/hgtip/">twitter</a> &mdash;
                 <a href="/about/">about</a>

Want to view all the details of a changeset? Add an hg show alias.