summaryrefslogtreecommitdiff
path: root/themes/agnoster.zsh-theme
diff options
context:
space:
mode:
authorgrindhold <grindhold@users.noreply.github.com>2016-09-20 05:00:42 +0200
committerRobby Russell <robby@planetargon.com>2016-09-19 20:00:42 -0700
commitd1ce70f68540bdf6a7f27ab9879e8222d0e7a604 (patch)
treefe5bd6fb7432441b56cd9fc9367d6c84df1e1b20 /themes/agnoster.zsh-theme
parentfb8953d525ddd3ed01db02a266b284bd9fa5fbd2 (diff)
downloadzsh-d1ce70f68540bdf6a7f27ab9879e8222d0e7a604.tar.gz
zsh-d1ce70f68540bdf6a7f27ab9879e8222d0e7a604.tar.bz2
zsh-d1ce70f68540bdf6a7f27ab9879e8222d0e7a604.zip
added support for bazaar in agnoster theme (#5016)
the agnoster theme is now able to render basic information if the user is currently residing inside a bazaar folder. if so, it will render a green promt segment with "bzr" and the current revision number in it. if there are untracked files, the bar will be rendered in yellow. if there are changes to already tracked files, a + character will be printed.
Diffstat (limited to 'themes/agnoster.zsh-theme')
-rw-r--r--themes/agnoster.zsh-theme22
1 files changed, 22 insertions, 0 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index da1f9b6e6..e1a294ee8 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -127,6 +127,27 @@ prompt_git() {
fi
}
+prompt_bzr() {
+ if (bzr status >/dev/null 2>&1); then
+ status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
+ status_all=`bzr status | head -n1 | wc -m`
+ revision=`bzr log | head -n2 | tail -n1 | sed 's/^revno: //'`
+ if [[ $status_mod -gt 0 ]] ; then
+ prompt_segment yellow black
+ echo -n "bzr@"$revision "✚ "
+ else
+ if [[ $status_all -gt 0 ]] ; then
+ prompt_segment yellow black
+ echo -n "bzr@"$revision
+
+ else
+ prompt_segment green black
+ echo -n "bzr@"$revision
+ fi
+ fi
+ fi
+}
+
prompt_hg() {
(( $+commands[hg] )) || return
local rev status
@@ -198,6 +219,7 @@ build_prompt() {
prompt_context
prompt_dir
prompt_git
+ prompt_bzr
prompt_hg
prompt_end
}