mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Updates to style and svn plugin (correct branch display)
Conflicts: plugins/svn/svn.plugin.zsh
This commit is contained in:
parent
e8d582aba9
commit
2c91b05396
1 changed files with 6 additions and 7 deletions
|
|
@ -1,22 +1,21 @@
|
||||||
function svn_prompt_info {
|
function svn_prompt_info {
|
||||||
if [ $(in_svn) ]; then
|
if [ $(in_svn) ]; then
|
||||||
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
|
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
|
||||||
$ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
|
$ZSH_THEME_REPO_NAME_COLOR$(svn_get_branch_name):$(svn_get_rev_nr)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function in_svn() {
|
function in_svn() {
|
||||||
if [[ -d .svn ]]; then
|
info=$(svn info 2> /dev/null) || return
|
||||||
|
if [ $info ]; then
|
||||||
echo 1
|
echo 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function svn_get_repo_name {
|
function svn_get_branch_name {
|
||||||
if [ $(in_svn) ]; then
|
if [ $(in_svn) ]; then
|
||||||
svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
|
svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$' | read SVN_URL
|
||||||
|
echo $SVN_URL
|
||||||
svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue