mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
ADDED: Mercurial repository info
This commit is contained in:
parent
615e41b0ec
commit
8e9cf45200
1 changed files with 20 additions and 0 deletions
|
@ -83,6 +83,25 @@ prompt_git() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prompt_hg() {
|
||||||
|
local rev status
|
||||||
|
if $(hg id >/dev/null 2>&1); then
|
||||||
|
if $(hg prompt >/dev/null 2>&1); then
|
||||||
|
rev=$(hg prompt {status})
|
||||||
|
if [[ $rev = "?" ]]; then
|
||||||
|
prompt_segment red white
|
||||||
|
rev='±'
|
||||||
|
elif [[ -n $rev ]]; then
|
||||||
|
prompt_segment yellow black
|
||||||
|
rev='±'
|
||||||
|
else
|
||||||
|
prompt_segment green black
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo -n $(hg prompt "⭠ {rev}@{branch}") $rev
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
prompt_segment blue black '%~'
|
prompt_segment blue black '%~'
|
||||||
|
@ -109,6 +128,7 @@ build_prompt() {
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
prompt_git
|
prompt_git
|
||||||
|
prompt_hg
|
||||||
prompt_end
|
prompt_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue