Added "hg_prompt_info" to base theme - it is used by scm_prompt_info
parent
ce4a6e6f26
commit
bb99031325
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue