about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_svn10
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a82b46570..b21bdefed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2020-03-26  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 45625: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn:
+	vcs_info svn: Detect the "working copy format is too new" error.
+
 	* 45626: Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr,
 	Functions/VCS_Info/Backends/VCS_INFO_get_data_p4,
 	Functions/VCS_Info/Backends/VCS_INFO_get_data_svk,
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index 6fbd673a7..b33efc2fb 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
@@ -10,6 +10,7 @@ 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
+integer -r SVN_ERR_WC_UNSUPPORTED_FORMAT=155021
 
 svnbase=".";
 svninfo=()
@@ -22,7 +23,14 @@ 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'
+    # User should run 'svn upgrade'
+    VCS_INFO_formats '' '?' '?' '' '' '?' 'working copy upgrade required'
+    return $?
+  elif (( rc == 1 )) && [[ -n ${(M)dat:#"svn: E${SVN_ERR_WC_UNSUPPORTED_FORMAT}: "*} ]]; then
+    hook_com=()
+    # User probably needs to install a newer svn, but we're not sure, so point
+    # the user to svn's error message.
+    VCS_INFO_formats '' '?' '?' '' '' '?' 'svn error'
     return $?
   else
     return 1