extend mercurial plugin

I want to display branch names and staging status of mercurial repositories in my promt. 
Thus, the mercurial plugin was extended to define some functions (similar to the svn plugin).

Implement: in_hg(), hg_get_branch_name(), hg_prompt_info(), and hg_dirty()