zsh-users
 help / color / mirror / code / Atom feed
dd5ce1b0f9487b6fb09ea7aaed062e3cfacdc3a5 blob 3136 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
 
## vim:ft=zsh
## subversion support by:
##  + Frank Terbeck <ft@bewatermyfriend.org>
##  + Phil Pennock
## Distributed under the same BSD-ish license as zsh itself.

setopt localoptions noksharrays extendedglob NO_shwordsplit
local svnbase svnbranch a b rrn
local non_uniform_revision modified
local -i rc
local -A svninfo parentinfo cwdinfo
local -A hook_com
integer -r SVN_ERR_WC_UPGRADE_REQUIRED=155036 # from /usr/local/include/subversion-1/svn_error_codes.h

svnbase=".";
svninfo=()
# Unfortunately, `$pipestatus' is broken currently. Until that problem is
# resolved, here is a workaround that will get things done, without using it.
# Clumsily, but that's life.
local -a dat
dat=( ${(f)"$(${vcs_comm[cmd]} info --non-interactive 2>&1)"} )
rc=$?
if (( rc != 0 )) ; then
  if (( rc == 1 )) && [[ -n ${(M)dat:#"svn: E${SVN_ERR_WC_UPGRADE_REQUIRED}: "*} ]]; then
    hook_com=()
    VCS_INFO_formats '' '?' '?' '' '' '?' 'upgrade required'
    return $?
  else
    return 1
  fi
fi
# The following line is the real code, the following is the workaround.
#${vcs_comm[cmd]} info --non-interactive \
print -l "${dat[@]}" \
|& while IFS=: read a b; do
    svninfo[${a// /_}]="${b## #}"
done
#rc=${pipestatus[1]}
#(( rc != 0 )) && return 1

cwdinfo=(${(kv)svninfo})

# Set svnbase to the wcroot path and svninfo to its `svn info`.
if (( ${+svninfo[Working_Copy_Root_Path]} )); then
  # svn 1.7+
  svnbase=${svninfo[Working_Copy_Root_Path]}
  ${vcs_comm[cmd]} info --non-interactive -- "${svnbase}" | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done
else
  # 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=${svnbase:P}

rrn=${svnbase:t}
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r"
hook_com=( branch "${svninfo[URL]##*/}" revision "${cwdinfo[Revision]}" )
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" &&
   zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "get-revision" ; then
    local svnversion_cmd
    if [[ $vcs_comm[cmd] == */* ]]; then
        svnversion_cmd=${vcs_comm[cmd]:h}/${${vcs_comm[cmd]:t}/svn/svnversion}
    else
        svnversion_cmd=${vcs_comm[cmd]/svn/svnversion}
    fi
    hook_com[svnversion]=$($svnversion_cmd 2>/dev/null)
    if [[ ${hook_com[svnversion]} == *M* ]]; then
        modified=${hook_com[svnversion]}
    fi
    if [[ ${hook_com[svnversion]} == *:* ]]; then
        non_uniform_revision=${hook_com[svnversion]}
    fi
fi
if VCS_INFO_hook 'set-branch-format' "${svnbranch}"; then
    zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}" "v:${hook_com[svnversion]}"
else
    svnbranch=${hook_com[branch-replace]}
fi
hook_com=()
VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' "$modified" "${non_uniform_revision:-${cwdinfo[Revision]}}" ''
return 0
debug log:

solving dd5ce1b0f ...
found dd5ce1b0f in https://inbox.vuxu.org/zsh-users/20191201005217.m4rpqq623l4vapwe@tarpaulin.shahaf.local2/
found c1547950f in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 c1547950f10001e79f1d7c856a72c7852b2f7ae8	Functions/VCS_Info/Backends/VCS_INFO_get_data_svn

applying [1/1] https://inbox.vuxu.org/zsh-users/20191201005217.m4rpqq623l4vapwe@tarpaulin.shahaf.local2/
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index c1547950f..dd5ce1b0f 100644

Checking patch Functions/VCS_Info/Backends/VCS_INFO_get_data_svn...
Applied patch Functions/VCS_Info/Backends/VCS_INFO_get_data_svn cleanly.

index at:
100644 dd5ce1b0f9487b6fb09ea7aaed062e3cfacdc3a5	Functions/VCS_Info/Backends/VCS_INFO_get_data_svn

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).