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

43030: Replace VCS_INFO_realpath() by :P

This commit is contained in:
dana 2018-06-16 12:03:23 -05:00
parent 0daeed20e1
commit faa07d064b
8 changed files with 19 additions and 20 deletions

View file

@ -1,5 +1,13 @@
2018-06-16 dana <dana@dana.is> 2018-06-16 dana <dana@dana.is>
* 43030: Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr,
Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs,
Functions/VCS_Info/Backends/VCS_INFO_get_data_svn,
Functions/VCS_Info/Backends/VCS_INFO_get_data_tla,
Functions/VCS_Info/VCS_INFO_bydir_detect,
Functions/VCS_Info/VCS_INFO_realpath,
Functions/VCS_Info/vcs_info: Replace VCS_INFO_realpath() by :P
* 43031: Etc/completion-style-guide: Add note about quoting/escaping * 43031: Etc/completion-style-guide: Add note about quoting/escaping
(cf. 42992) (cf. 42992)

View file

@ -81,7 +81,7 @@ else
bzrbase=${bzr_info[branch_root]} ;; bzrbase=${bzr_info[branch_root]} ;;
esac esac
bzrbase="$(VCS_INFO_realpath ${bzrbase})" bzrbase=${bzrbase:P}
if [ -n "${bzr_info[checkout_of_branch]}" ] && \ if [ -n "${bzr_info[checkout_of_branch]}" ] && \
zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "use-server" zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "use-server"

View file

@ -9,7 +9,7 @@ cvsbase="."
while [[ -d "${cvsbase}/../CVS" ]]; do while [[ -d "${cvsbase}/../CVS" ]]; do
cvsbase="${cvsbase}/.." cvsbase="${cvsbase}/.."
done done
cvsbase="$(VCS_INFO_realpath ${cvsbase})" cvsbase=${cvsbase:P}
cvsbranch=$(< ./CVS/Repository) cvsbranch=$(< ./CVS/Repository)
rrn=${cvsbase:t} rrn=${cvsbase:t}
cvsbranch=${cvsbranch##${rrn}/} cvsbranch=${cvsbranch##${rrn}/}

View file

@ -46,7 +46,7 @@ else
done done
fi fi
svnbase="$(VCS_INFO_realpath ${svnbase})" svnbase=${svnbase:P}
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"

View file

@ -5,7 +5,7 @@
setopt localoptions extendedglob NO_shwordsplit setopt localoptions extendedglob NO_shwordsplit
local tlabase tlabranch local tlabase tlabranch
tlabase="$(VCS_INFO_realpath ${vcs_comm[basedir]})" tlabase=${vcs_comm[basedir]:P}
rrn=${tlabase:t} rrn=${tlabase:t}
# tree-id gives us something like 'foo@example.com/demo--1.0--patch-4', so: # tree-id gives us something like 'foo@example.com/demo--1.0--patch-4', so:
tlabranch=${${"$( ${vcs_comm[cmd]} tree-id )"}/*\//} tlabranch=${${"$( ${vcs_comm[cmd]} tree-id )"}/*\//}

View file

@ -4,11 +4,11 @@
setopt localoptions NO_shwordsplit setopt localoptions NO_shwordsplit
local dirname=$1 local dirname=$1
local basedir="." realbasedir file local basedir="." file
realbasedir="$(VCS_INFO_realpath ${basedir})" basedir=${basedir:P}
while [[ ${realbasedir} != '/' ]]; do while [[ ${basedir} != '/' ]]; do
[[ -r ${realbasedir} ]] || return 1 [[ -r ${basedir} ]] || return 1
if [[ -n ${vcs_comm[detect_need_file]} ]] ; then if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
[[ -d ${basedir}/${dirname} ]] && { [[ -d ${basedir}/${dirname} ]] && {
for file in ${(s: :)${vcs_comm[detect_need_file]}}; do for file in ${(s: :)${vcs_comm[detect_need_file]}}; do
@ -19,10 +19,9 @@ while [[ ${realbasedir} != '/' ]]; do
[[ -d ${basedir}/${dirname} ]] && break [[ -d ${basedir}/${dirname} ]] && break
fi fi
basedir=${basedir}/.. basedir=${basedir:h}
realbasedir="$(VCS_INFO_realpath ${basedir})"
done done
[[ ${realbasedir} == "/" ]] && return 1 [[ ${basedir} == "/" ]] && return 1
vcs_comm[basedir]=${realbasedir} vcs_comm[basedir]=${basedir}
return 0 return 0

View file

@ -1,7 +0,0 @@
## vim:ft=zsh
## Written by Frank Terbeck <ft@bewatermyfriend.org>
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit chaselinks
# -q to avoid chpwd() invocations
( builtin cd -q $1 2>/dev/null && pwd; )

View file

@ -26,7 +26,6 @@ static_functions=(
VCS_INFO_nvcsformats VCS_INFO_nvcsformats
VCS_INFO_patch2subject VCS_INFO_patch2subject
VCS_INFO_quilt VCS_INFO_quilt
VCS_INFO_realpath
VCS_INFO_reposub VCS_INFO_reposub
VCS_INFO_set VCS_INFO_set