zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] vcs_info svn: Recognize working copies in need of an upgrade.
@ 2018-09-30 22:16 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2018-09-30 22:16 UTC (permalink / raw)
  To: zsh-workers

---
To test this:

% svnadmin create r
% svn co -q file://$PWD/r wc
% cd wc 
% rm -f .svn/wc.wb
% echo 9 >! .svn/format >! .svn/entries
% 

I wonder if more errors should be handled.

Cheers,

Daniel


 Functions/VCS_Info/Backends/VCS_INFO_get_data_svn | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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[@]}" \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-30 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-30 22:16 [PATCH] vcs_info svn: Recognize working copies in need of an upgrade Daniel Shahaf

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).