Integrates Bazaar in agnoster theme and adds a Bazaar plugin

This commit is contained in:
Emanuel Angelo 2016-04-19 01:46:59 +01:00
parent 656ddabcfa
commit 8228ed202c
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

@ -162,6 +162,27 @@ prompt_hg() {
fi 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 # Dir: current working directory
prompt_dir() { prompt_dir() {
prompt_segment blue black '%~' prompt_segment blue black '%~'
@ -198,6 +219,7 @@ build_prompt() {
prompt_dir prompt_dir
prompt_git prompt_git
prompt_hg prompt_hg
prompt_bzr
prompt_end prompt_end
} }