This commit is contained in:
Emanuel de Jesus 2018-04-17 20:53:26 +00:00 committed by GitHub
commit f5ea3efc00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# Bazaar
alias b='bzr'
alias bs='bzr status'
alias bi='bzr info'
alias bpl='bzr pull'
alias bcom='bzr commit'
alias bd='bzr diff'
alias bl='bzr log'
alias bps='bzr push'
alias ba='bzr add'

View File

@ -185,6 +185,27 @@ prompt_hg() {
fi
}
prompt_bzr() {
local rev status branch
branch=`bzr nick 2>/dev/null`
if [[ -n $branch ]]; then
if [[ -n `bzr status | grep unknown` ]]; then
# if files are not added
prompt_segment red white
st='±'
elif [[ -n `bzr status | grep -E "added|modified"` ]]; then
# if any modification
prompt_segment yellow black
st='±'
else
# if working copy is clean
prompt_segment green black
fi
rev=`bzr tip --line 2>/dev/null | cut -d ':' -f 1`
echo -n "⛗ $rev@$branch" $st
fi
}
# Dir: current working directory
prompt_dir() {
prompt_segment blue black '%~'
@ -222,6 +243,7 @@ build_prompt() {
prompt_git
prompt_bzr
prompt_hg
prompt_bzr
prompt_end
}