diff --git a/plugins/bazaar/bazaar.plugin.zsh b/plugins/bazaar/bazaar.plugin.zsh new file mode 100644 index 00000000..7e51ee0b --- /dev/null +++ b/plugins/bazaar/bazaar.plugin.zsh @@ -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' diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 103041ee..e7681dc9 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -162,6 +162,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 '%~' @@ -198,6 +219,7 @@ build_prompt() { prompt_dir prompt_git prompt_hg + prompt_bzr prompt_end }