zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: <zsh-workers@zsh.org>
Subject: Re: Issue with vcs_info and zsh 4.3.14
Date: Fri, 23 Dec 2011 10:38:59 +0100	[thread overview]
Message-ID: <87ehvvwrt8.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <87mxb1zkcd.fsf@ft.bewatermyfriend.org> (Frank Terbeck's message of "Fri, 09 Dec 2011 19:11:14 +0100")

Frank Terbeck wrote:
[...]
> +    if [[ "$a $b" == *E155007* ]] \
> +        || [[ "$a $b" == *'is not a working copy'* ]]

So... long time, no mail about this.

I've discussed this a little more with Daniel on IRC. And it turns out,
there would be more than one error to check for here.

And I'm not going to do that. Instead, I want to check for the return
code of calling "svn info" and bail out if that's non-zero.

I wanted to do that with `$pipestatus[]', but I've stumbled across a
rather severe issue with that (see workers-29973 for details). So, in
the meantime, I'll commit patch included below. It contains the code I
really want to use (commented out) and a clumsier approach using a
temporary array `$dat[]'. As soon as the `pipestatus' issue is resolved,
I'll be removing the workaround. But I'd like to get an svn-1.7 enabled
vcs_info going.

Regards, Frank


diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index b1cb730..41cc3e7 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
@@ -6,12 +6,28 @@
 
 setopt localoptions noksharrays extendedglob NO_shwordsplit
 local svnbase svnbranch a b rrn
+local -i rc
 local -A svninfo parentinfo
 local -xA hook_com
 
 svnbase=".";
 svninfo=()
-${vcs_comm[cmd]} info --non-interactive | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done
+# 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=$?
+(( rc != 0 )) && return 1
+# 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
+
 while [[ -d "${svnbase}/../.svn" ]]; do
     parentinfo=()
     ${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done


      reply	other threads:[~2011-12-23 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 14:03 Pierre Schmitz
2011-12-07 20:24 ` Daniel Shahaf
2011-12-09 18:11 ` Frank Terbeck
2011-12-23  9:38   ` Frank Terbeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehvvwrt8.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).