Pretty colors: Syntax Highlighting in Mercurial

I recently switched my personal revision control system from subversion to mercurial. One of the great things about mercurial is the built-in web interface, but I missed the syntax highlighting that’s available in interfaces such as ViewVC.

I’ve written a mercurial extension that applies pygments code highlighting. This extension is now available in the main mercurial repo.

To enable it, install pygments and add the following entry to hgrc:

[extension]
hgext.highlight =

An example of the output.

Thanks to micha who wrote an initial patch.

This entry was posted in Mercurial, Python. Bookmark the permalink.

Leave a Reply