Added "hg_prompt_info" to base theme - it is used by scm_prompt_info

pull/56/head
Daniel Leavitt 2011-06-17 14:38:49 -07:00
parent ce4a6e6f26
commit bb99031325
1 changed files with 14 additions and 0 deletions

View File

@ -82,6 +82,20 @@ function svn_prompt_info {
echo -e "$prefix$ref$state$suffix"
}
function hg_prompt_info() {
if [[ -n $(hg status 2> /dev/null) ]]; then
state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY}
else
state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
fi
prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}')
changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}')
echo -e "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix"
}
function rvm_version_prompt {
if which rvm &> /dev/null; then
rvm=$(rvm tools identifier) || return