Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use Activity extension of Mercurial

📅 2014-Apr-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

[caption id="attachment_4437" align="aligncenter" width="640"][Display of activities on a Mercurial repository](http://codeyarns.files.wordpress.com/2014/04/20140414-hgactivity.png) Display of activities on a Mercurial repository[/caption]

The Punchcard extension of Mercurial can be used to obtain a calendar chart of your contributions to a repository, as shown in here. If you need to view the classic line graph of activities in a Mercurial repository, then the Activity extension is a great solution.

$ sudo apt-get purge python-matplotlib python-matplotlib-data
$ sudo pip install --upgrade matplotlib
$ hg clone http://sources.freehackers.org/Hgactivity/
[extensions]
activity=/path/to/Hgactivity/activity
$ hg activity --mode=gui

You can view commits, branches, tags and users. Activities across different files and directories can be viewed by choosing options in the GUI.

$ hg activity --mode=file
[alias]
gact = activity --mode=gui

After this, you can use the alias instead of the more verbose form:

$ hg gact

Tried with: Mercurial 2.8.2, Matplotlib 1.5.0 and Ubuntu 14.04