Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] vcs_info svn: Use the revision of cwd

Previously, the value of the wc root would be used.  In Subversion,
it makes more sense to use the revision of cwd, since all commands
(e.g., 'svn ci', 'svnversion') operate only on cwd and below, not on
wcroot and below.
This could happen if the working copy is checked out from trunk's
parent, or simply if one works on a single module and runs a few
updates/commits within that module's directory within the project.

 Functions/VCS_Info/Backends/VCS_INFO_get_data_svn |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index 41cc3e7..ae3c499 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
@@ -7,7 +7,7 @@
 setopt localoptions noksharrays extendedglob NO_shwordsplit
 local svnbase svnbranch a b rrn
 local -i rc
-local -A svninfo parentinfo
+local -A svninfo parentinfo cwdinfo
 local -xA hook_com
@@ -28,6 +28,8 @@ done
 #(( rc != 0 )) && return 1
 while [[ -d "${svnbase}/../.svn" ]]; do
     ${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done
@@ -40,12 +42,12 @@ svnbase="$(VCS_INFO_realpath ${svnbase})"
 zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r"
-hook_com=( branch "${svninfo[URL]##*/}" revision "${svninfo[Revision]}" )
+hook_com=( branch "${svninfo[URL]##*/}" revision "${cwdinfo[Revision]}" )
 if VCS_INFO_hook 'set-branch-format' "${svnbranch}"; then
     zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}"
-VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${svninfo[Revision]}" ''
+VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${cwdinfo[Revision]}" ''
 return 0

Messages sorted by: Reverse Date, Date, Thread, Author