Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] vcs_info svn: Recognize working copies in need of an upgrade.
- X-seq: zsh-workers 43585
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] vcs_info svn: Recognize working copies in need of an upgrade.
- Date: Sun, 30 Sep 2018 22:16:08 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=eht/i2GEqEH504Hsn to/+7m6MEz2ujg6Wo3pAbRAJ0I=; b=TwpytOOGQQFssJn/oyRgmW7pgL9ZYSkRh tTgyYD07hFKol3gQl4UEqHUblJBj2/g6BN+fCssDIs7ZWW57FOhSyuNELaeeqfJA IdqdpU2dvTHOqDX8iby3uLJ2DfrPmAy5sssOw/20FE4K0Gy11H680OyJgIjKkjWv rQlAFZmIHqHzJvLclV9bza1jdJ9VJUv+0VaK4U7okzuXSl5fvDOvEH01eYxDtY0G bZNMe1XquK2+daB7IDQ9BToK5n9h2sqzArC3uirU6Chv7ArReehKswEjb0YVa7Vx bhQsM8cNhhHsgeu0LNbbhOcpqQYzM4kzLBdd1Oijg6Wll4dVpXEpw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=eht/i2GEqEH504Hsn to/+7m6MEz2ujg6Wo3pAbRAJ0I=; b=scDMXmpSfIBywRM0MZ7Kj+enr+l1JoEv6 N1GxIVyLr8/zFyflwHngoHgloa2uTh1TeLIXtqby0xKrsARYTHl0b2FtzAnjXSWT FngFmGssJja2yp1zjpilK4FHvuG690DO3EVgwXpQZ6d+f3bLPiSrBSxuXUcJSS0/ rfCN2renzPjFoxEk3cQQZwDrLKFeoEnNxwWpv9ZWgmvET7/KwqX7wLPLCFMhq6t/ elx6QlQAgISc82dkeKfqCNfR867pvbXSmFgbG2T5ieZb1FBcFO7ilcdVVwBvV+wz mXxN2JR9jS3KwfCfYrPaEXNQLM8ErHHTwhhBlGbjFs1cEJo46iYjQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
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[@]}" \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author