This commit is contained in:
Kaleb Elwert 2018-04-17 20:43:55 +00:00 committed by GitHub
commit 18ee8b863e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,25 +128,24 @@ prompt_git() {
} }
prompt_bzr() { prompt_bzr() {
(( $+commands[bzr] )) || return (( $+commands[bzr] )) || return
if (bzr status >/dev/null 2>&1); then if (bzr status >/dev/null 2>&1); then
status_mod=`bzr status | head -n1 | grep "modified" | wc -m` status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
status_all=`bzr status | head -n1 | wc -m` status_all=`bzr status | head -n1 | wc -m`
revision=`bzr log | head -n2 | tail -n1 | sed 's/^revno: //'` revision=`bzr log | head -n2 | tail -n1 | sed 's/^revno: //'`
if [[ $status_mod -gt 0 ]] ; then if [[ $status_mod -gt 0 ]] ; then
prompt_segment yellow black prompt_segment yellow black
echo -n "bzr@"$revision "✚ " echo -n "bzr@"$revision "✚ "
else else
if [[ $status_all -gt 0 ]] ; then if [[ $status_all -gt 0 ]]; then
prompt_segment yellow black prompt_segment yellow black
echo -n "bzr@"$revision echo -n "bzr@"$revision
else
else prompt_segment green black
prompt_segment green black echo -n "bzr@"$revision
echo -n "bzr@"$revision fi
fi
fi
fi fi
fi
} }
prompt_hg() { prompt_hg() {