BREAKING CHANGE: the `hg_prompt_info` function now uses `ZSH_THEME_HG_PROMPT_PREFIX`
and `ZSH_THEME_HG_PROMPT_SUFFIX` variables when displaying branch information, similar
to the `git_prompt_info` function.
Closes#6631
Replaced two different calls of hg with one `hg --id --branch` for retrieving
information whether we're in a repo (will be empty if not), whether the repo is
dirty (revision id will contain "+" if there are uncommitted changed), and the
branch name.
Closes#6197Closes#7929
Rather than trying to emulate `git commit --amend` using mercurial queues (which might have side effects if you're using MQ for other things) use the `commit --amend` command which was introduced in Mercurial 2.2 (2012-05-01).
If a user sets ZSH_THEME_HG_PROMPT_* as the following, he ends up with
%{$reset_color%} resetting the bold style of last character ")" because
_SUFFIX was expanded before calling hg_dirty():
ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[blue]%}hg:(%{$fg[white]%}"
ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[blue]%})"
With this patch, the variable ZSH_THEME_HG_PROMPT_SUFFIX is lastly
displayed, following the same order as in git_prompt_info(),
i.e. <prefix><dirty><suffix>.
The original hgic and hgoc aliases worked well for the default path, but attempting to call them with a different path failed. I created functions to handle them instead.
implement in_hg(), hg_get_branch_name(), hg_prompt_info(), and hg_dirty() for the mercurial plugin
named functions similar to subversion plugin, to give theme maintainers an easier life
The -v flag for these commands really isn't very useful. It will
output some information about the hooks it is running, but that is
generally not useful and just noisy. The desire to add -v to these
commands is exceptional and IMHO it's better to make the common
case of not seeing those messages the supported behavior.