1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

32619: 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 commit is contained in:
Daniel Shahaf 2014-05-25 21:53:35 +00:00 committed by Frank Terbeck
parent d082827c83
commit bb271217fe
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2014-05-29 Daniel Shahaf <d.s@daniel.shahaf.name>
* 32619: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn:
vcs_info svn: Use the revision of cwd
2014-05-18 Peter Stephenson <p.w.stephenson@ntlworld.com> 2014-05-18 Peter Stephenson <p.w.stephenson@ntlworld.com>
* Jun T: 32616: Src/Builtins/rlimits.c: unnecessary printf * Jun T: 32616: Src/Builtins/rlimits.c: unnecessary printf

View file

@ -7,7 +7,7 @@
setopt localoptions noksharrays extendedglob NO_shwordsplit setopt localoptions noksharrays extendedglob NO_shwordsplit
local svnbase svnbranch a b rrn local svnbase svnbranch a b rrn
local -i rc local -i rc
local -A svninfo parentinfo local -A svninfo parentinfo cwdinfo
local -xA hook_com local -xA hook_com
svnbase="."; svnbase=".";
@ -28,6 +28,8 @@ done
#rc=${pipestatus[1]} #rc=${pipestatus[1]}
#(( rc != 0 )) && return 1 #(( rc != 0 )) && return 1
cwdinfo=(${(kv)svninfo})
while [[ -d "${svnbase}/../.svn" ]]; do while [[ -d "${svnbase}/../.svn" ]]; do
parentinfo=() parentinfo=()
${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done ${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})"
rrn=${svnbase:t} rrn=${svnbase:t}
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r" 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 if VCS_INFO_hook 'set-branch-format' "${svnbranch}"; then
zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}" zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}"
else else
svnbranch=${hook_com[branch-replace]} svnbranch=${hook_com[branch-replace]}
fi fi
hook_com=() hook_com=()
VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${svninfo[Revision]}" '' VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${cwdinfo[Revision]}" ''
return 0 return 0