mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Added very basic hg scm plugin. Compared to git and svn it's very slow.
todo: look for a faster way to get the status (dirty/clean)
This commit is contained in:
parent
b989ec489c
commit
57a018504a
1 changed files with 25 additions and 0 deletions
25
scm/hg.scm.zsh
Normal file
25
scm/hg.scm.zsh
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
function scm_in_hg_repo () {
|
||||||
|
if [[ -d .hg ]]; then
|
||||||
|
echo 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function scm_hg_prompt_info {
|
||||||
|
out="$ZSH_THEME_SCM_PROMPT_PREFIX$(cat .hg/branch)$(parse_hg_dirty)$ZSH_THEME_SCM_PROMPT_SUFFIX"
|
||||||
|
if [[ ZSH_THEME_SCM_DISPLAY_NAME -eq 1 ]]; then
|
||||||
|
out="hg$out"
|
||||||
|
fi
|
||||||
|
echo $out
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function parse_hg_dirty {
|
||||||
|
s=$(hg status 2>/dev/null)
|
||||||
|
if [ $s ]; then
|
||||||
|
echo $ZSH_THEME_SCM_PROMPT_DIRTY
|
||||||
|
else
|
||||||
|
echo $ZSH_THEME_SCM_PROMPT_CLEAN
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
ZSH_THEME_SVN_NAME="hg"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue