hg PS1 bash shell helper

Simple bash function to include hg information in PS1 variable in bash shell. (Gist)

Code:

#!/bin/bash
#
# Ref: http://unix.stackexchange.com/questions/66581
# For getting both exit status and output from command
#
# __hg_ps1 …