about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2018-09-30 22:16:08 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2018-10-07 15:05:13 +0000
commitabc94e8f6aa8367ce9d6e972d55f8e7d34fb08ec (patch)
treed1bd74f7ead983ca1e1e7e6f2013d1fc27b91e61
parent0290757ed4ed7d99b5bab5d92933dd6026af9fff (diff)
downloadzsh-abc94e8f6aa8367ce9d6e972d55f8e7d34fb08ec.tar.gz
zsh-abc94e8f6aa8367ce9d6e972d55f8e7d34fb08ec.tar.xz
zsh-abc94e8f6aa8367ce9d6e972d55f8e7d34fb08ec.zip
43585: vcs_info svn: Recognize working copies in need of an upgrade.
-rw-r--r--ChangeLog5
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_svn11
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ece6efdad..936b76a6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-07  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 43585: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn:
+	vcs_info svn: Recognize working copies in need of an upgrade.
+
 2018-10-03  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* unposted: Etc/FAQ.yo: minor typos.
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index a773a727d..c1547950f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
@@ -9,6 +9,7 @@ local svnbase svnbranch a b rrn
 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=()
@@ -18,7 +19,15 @@ svninfo=()
 local -a dat
 dat=( ${(f)"$(${vcs_comm[cmd]} info --non-interactive 2>&1)"} )
 rc=$?
-(( rc != 0 )) && return 1
+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[@]}" \