1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-30 05:40:58 +01:00

32621: vcs_info svn: 'Fix set-branch-format' when in subdirs

The previous code would fail to detect the wcroot with Subversion 1.7+
when cwd is at least two levels below the root (i.e., ../../.svn exists
and ../.svn doesn't), and would then pass to the hook the revision and
basename of cwd rather than of the wcroot.
This commit is contained in:
Daniel Shahaf 2014-05-25 21:56:26 +00:00 committed by Frank Terbeck
parent bb271217fe
commit 55d5feed30
2 changed files with 18 additions and 7 deletions

View file

@ -3,6 +3,9 @@
* 32619: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn: * 32619: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn:
vcs_info svn: Use the revision of cwd vcs_info svn: Use the revision of cwd
* 32621: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn:
vcs_info svn: 'Fix set-branch-format' when in subdirs
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

@ -30,13 +30,21 @@ done
cwdinfo=(${(kv)svninfo}) cwdinfo=(${(kv)svninfo})
while [[ -d "${svnbase}/../.svn" ]]; do # Set svnbase to the wcroot path and svninfo to its `svn info`.
parentinfo=() if (( ${+svninfo[Working_Copy_Root_Path]} )); then
${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done # svn 1.7+
[[ ${parentinfo[Repository_UUID]} != ${svninfo[Repository_UUID]} ]] && break svnbase=${svninfo[Working_Copy_Root_Path]}
svninfo=(${(kv)parentinfo}) ${vcs_comm[cmd]} info --non-interactive -- "${svnbase}" | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done
svnbase="${svnbase}/.." else
done # svn 1.0-1.6
while [[ -d "${svnbase}/../.svn" ]]; do
parentinfo=()
${vcs_comm[cmd]} info --non-interactive -- "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done
[[ ${parentinfo[Repository_UUID]} != ${svninfo[Repository_UUID]} ]] && break
svninfo=(${(kv)parentinfo})
svnbase="${svnbase}/.."
done
fi
svnbase="$(VCS_INFO_realpath ${svnbase})" svnbase="$(VCS_INFO_realpath ${svnbase})"