Extract hg_status
variable
This commit is contained in:
parent
194c5b1ca3
commit
3ff5de73e2
@ -17,15 +17,19 @@ hg_prompt_info()
|
||||
local STATUS=""
|
||||
if $(hg id >/dev/null 2>&1); then
|
||||
local BRANCH=$(hg branch 2>/dev/null)
|
||||
if `hg status | grep -q "^\?"`; then
|
||||
local STATUS_OUTPUT=$(hg status)
|
||||
if echo $STATUS_OUTPUT | grep -q "^\?"; then
|
||||
STATUS="$ZSH_THEME_HG_PROMPT_UNTRACKED"
|
||||
fi
|
||||
if `hg status | grep -q "^[A]"`; then
|
||||
if echo $STATUS_OUTPUT | grep -q "^[A]"; then
|
||||
STATUS="$ZSH_THEME_HG_PROMPT_ADDED$STATUS"
|
||||
fi
|
||||
if `hg status | grep -q "^[M]"`; then
|
||||
if echo $STATUS_OUTPUT | grep -q "^[M]"; then
|
||||
STATUS="$ZSH_THEME_HG_PROMPT_MODIFIED$STATUS"
|
||||
fi
|
||||
if [ ! "$STATUS" = "" ] ; then
|
||||
STATUS=" $STATUS"
|
||||
fi
|
||||
echo "$BRANCH$STATUS"
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user