From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11146 invoked by alias); 9 Dec 2011 19:41:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29965 Received: (qmail 7544 invoked from network); 9 Dec 2011 19:41:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (proxy.melb.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: Subject: Re: Issue with vcs_info and zsh 4.3.14 In-Reply-To: <91f8bdbd8b04c960f177e97d58423a08@archlinux.de> (Pierre Schmitz's message of "Wed, 07 Dec 2011 15:03:47 +0100") References: <91f8bdbd8b04c960f177e97d58423a08@archlinux.de> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Fri, 09 Dec 2011 19:11:14 +0100 Message-ID: <87mxb1zkcd.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Pierre Schmitz wrote: [...] > $ vcs_info > svn: '.' is not a working copy I think the patch below should fix this. Could you give it a test drive? > I also noticed that when calling VCS_INFO_get_data_svn svn complains > about the unknown option --non-interactive. Daniel assures me in IRC, that at least since subversion 1.6, every sub-command supports the `--non-interactive' option. Are you on a particularly old version of subversion where the --non-interactive errors are coming up? I don't think I want to put too much effort into actively supporting anything older than subversion 1.6. 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..2b51ea7 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn @@ -11,7 +11,20 @@ local -xA hook_com svnbase="."; svninfo=() -${vcs_comm[cmd]} info --non-interactive | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done +${vcs_comm[cmd]} info --non-interactive \ +|& while IFS=: read a b; do + # SVN 1.7+ prints out stable error numbers. The one below is the "not a + # working copy" error code. With prior versions we have to hope the error + # message fits. svn1.6 should spit out something that matches the 2nd + # pattern. + if [[ "$a $b" == *E155007* ]] \ + || [[ "$a $b" == *'is not a working copy'* ]] + then + return 1 + fi + svninfo[${a// /_}]="${b## #}" +done + while [[ -d "${svnbase}/../.svn" ]]; do parentinfo=() ${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done