Install mercurial with homebrew.
brew install mercurial
Get hg-prompt
from Bitbucket.
hg clone http://bitbucket.org/sjl/hg-prompt/ ~/src
Update extensions section in ~/.hgrc
[extensions]
prompt = ~/src/hg-prompt/prompt.py
Add mercurial plugin to the list of your zsh plugins ~/.zshrc
plugins=(git mercurial osx brew ruby rails)
Add the following after source $ZSH/oh-my-zsh.sh
or update your theme file ~/.oh-my-zsh/themes/%THEME.zsh-theme
function hg_prompt_info {
hg prompt --angle-brackets "\
<%{$fg_bold[blue]%}hg:(%{$fg_bold[red]%}<branch>><:<tags|, >%{$fg_bold[blue]%})>\
%{$fg[yellow]%}<status|modified|unknown><update>\
<patches: <patches|join( → )>>%{$reset_color%}" 2>/dev/null
}
PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'