Commit 5128669a authored by Yohann Bianchi's avatar Yohann Bianchi
Browse files

IMPROVED: untracked file status has priority over modified (ie: if you have...

IMPROVED: untracked file status has priority over modified (ie: if you have both modified and untracked files, your prompt will be red indicating the presence of untracked files)
parent 5eb3ec64
...@@ -87,12 +87,11 @@ prompt_hg() { ...@@ -87,12 +87,11 @@ prompt_hg() {
local rev status local rev status
if $(hg id >/dev/null 2>&1); then if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then if $(hg prompt >/dev/null 2>&1); then
st=$(hg prompt {status}) if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
if [[ $st = "?" ]]; then
# if files are not added # if files are not added
prompt_segment red white prompt_segment red white
st='±' st='±'
elif [[ -n $st ]]; then elif [[ -n $(hg prompt "{status|modified}") ]]; then
# if any modification # if any modification
prompt_segment yellow black prompt_segment yellow black
st='±' st='±'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment