We (nelchael and me) just finished a live ebuild [1] for Mercurial [2] which allows to conveniently track the main (mpm) repo [3] of Mercurial in Gentoo [4].
To use the ebuild, just add
=dev-util/mercurial-9999 **
to your package.keywords and emerge mercurial (again).
It took us a while since we had to revise the Mercurial eclass to always build Mercurial live packages from their Mercurial repository and nelchael took the chance to completely overhaul the eclass.
If you're interested in the details, please have a look at the ebuild [5] and the eclass [6] as well as the tracking bug [7].
To use the eclass in an ebuild, just add inherit mercurial at the beginning of the ebuild and set EHG_REPO_URI to the correct repository URI. If you need to share a single repository between several ebuilds, set EHG_PROJECT to the project name in all of them.
Have fun with Mercurial!
Links:
[1] http://packages.gentoo.org/package/dev-util/mercurial
[2] http://mercurial-scm.org
[3] http://selenic.com/repo/hg
[4] http://gentoo.org
[5] http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/mercurial/mercurial-9999.ebuild?view=markup
[6] http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mercurial.eclass?view=markup
[7] http://bugs.gentoo.org/251163