diff options
author | Robby Russell <robby@planetargon.com> | 2016-09-24 16:36:50 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2016-09-24 16:36:50 -0700 |
commit | a21d57a17070ca21561fdb64deb29821c4cc6f30 (patch) | |
tree | aeeb7124be4b233b21249ba018bb1c79d3cccfe0 /themes/agnoster.zsh-theme | |
parent | fdc59e5499c5aabfd287c73df66a4fb7472732e8 (diff) | |
parent | 1b7fc2f3aca32ba8713be0e27305c5cf578033f6 (diff) | |
download | zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.tar.gz zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.tar.bz2 zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.zip |
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
Diffstat (limited to 'themes/agnoster.zsh-theme')
-rw-r--r-- | themes/agnoster.zsh-theme | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index da1f9b6e6..07546fd34 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -86,7 +86,7 @@ prompt_context() { # Git: branch/detached head, dirty status prompt_git() { - + (( $+commands[git] )) || return local PL_BRANCH_CHAR () { local LC_ALL="" LC_CTYPE="en_US.UTF-8" @@ -127,6 +127,28 @@ prompt_git() { fi } +prompt_bzr() { + (( $+commands[bzr] )) || return + 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 +220,7 @@ build_prompt() { prompt_context prompt_dir prompt_git + prompt_bzr prompt_hg prompt_end } |