Find common ancestor of two revisions
hg debugancestor rev1 rev2
In older hg versions, you have to explicitly tell it to use the changelog, i.e.
hg debugancestor .hg/store/00changelog.i rev1 rev2
Starting from Mercurial 1.7 you can use such syntax (example show nested query syntax):
hg log -r "ancestor(rev1,ancestor(rev2,rev3))"