f66ab7f98f9be0486b3a55858d9466232fc97ef6

Author
Brice Dutheil <brice.dutheil@gmail.com>
Committer
Brice Dutheil <brice.dutheil@gmail.com>
Date

Message

Renamed the methods of this script

Diff

 1diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
 2index 2d43d365b13dd10675324ae053fce18cbf486092..a12007ec60eb434ecb9ba391adba3fede38c4843 100644
 3--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
 4+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
 5@@ -4,12 +4,10 @@
 6 #
 7 # Works with svn 1.6, 1.7, 1.8.
 8 # Use `svn_prompt_info` method to enquire the svn data.
 9-# It's faster because his efficient use of svn (single svn call) done in the `parse_svn` function
10-# Also changed prompt suffix *after* the svn dirty marker
11-#
12-# *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
13+# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
14+# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
15 
16-function svn_prompt_info() {
17+function svn_fast_info() {
18   local info
19   info=$(svn info 2>&1) || return 1; # capture stdout and stderr
20   local repo_need_upgrade=$(svn_repo_need_upgrade $info)
21@@ -32,10 +30,10 @@ function svn_prompt_info() {
22       $ZSH_PROMPT_BASE_COLOR \
23       \
24       $ZSH_THEME_BRANCH_NAME_COLOR \
25-      $(svn_get_branch_name $info) \
26+      $(svn_current_branch_name $info) \
27       $ZSH_PROMPT_BASE_COLOR \
28       \
29-      $(svn_get_revision $info) \
30+      $(svn_current_revision $info) \
31       $ZSH_PROMPT_BASE_COLOR \
32       \
33       $ZSH_THEME_SVN_PROMPT_SUFFIX \
34@@ -43,21 +41,20 @@ function svn_prompt_info() {
35   fi
36 }
37 
38-
39 function svn_repo_need_upgrade() {
40   grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
41     echo "E155036: upgrade repo with svn upgrade"
42 }
43 
44-function svn_get_branch_name() {
45+function svn_current_branch_name() {
46   grep '^URL:' <<< "${1:-$(svn info 2> /dev/null)}" | egrep -o '(tags|branches)/[^/]+|trunk'	
47 }
48 
49-function svn_get_repo_root_name() {
50+function svn_repo_root_name() {
51   grep '^Repository\ Root:' <<< "${1:-$(svn info 2> /dev/null)}" | sed 's#.*/##'
52 }
53 
54-function svn_get_revision() {
55+function svn_current_revision() {
56   echo "${1:-$(svn info 2> /dev/null)}" | sed -n 's/Revision: //p'
57 }
58