Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _subversion is going to need to use 'help -v'
- X-seq: zsh-workers 44726
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: _subversion is going to need to use 'help -v'
- Date: Wed, 04 Sep 2019 02:54:06 +0000
- Cc: "Cristiano De Michele" <cristiano.demichele@xxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type; s=fm1; bh=e1AI fzRyK4DSBTVfoG0cO3XLNrmZQo0wTKORP4IRnWk=; b=SzHaYzr4pqkPpVi6B6vH 7677vwJrsEvH/VYJjnvID69QfRPGvkw2PuhSl6C7/wzw/gL4HaHuPZp7R1jGZ4ox LEK7ieG5jhTCvbjWcigrgttlYjfJ+4WNW0c5bB8oXnw9KGZbOtz6uk8c1N34VdPu vXjnzMvvf3E/pHjZNDNKxOOi3AefOtpPEoQ/0CNo06wTtz/oPzmxlIbNd/W6XaEl 4FKXjzYKQj7osnvcDZdmMJLnohIOPOGs7+2s0GG4ejfr9anK57owoz/Xll6I37bQ sKQVDb/54aIdWwTW51x4VSLFnLpyK2WneQ8QTZwp8epiA1omZpp99u1fsSUXO8i9 lQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=e1AIfz RyK4DSBTVfoG0cO3XLNrmZQo0wTKORP4IRnWk=; b=I7DyRPxFAYU4DMznNkHqNX G1l0BMg2x7axzw/J4Gg8puJcXnV59K8mqF49DzpfiW9rj2z4MERVQ4KmpXtfELvD DTum4Fom3t3e0gqh9BKYV6E9Z1AFI/rlgXiPqRVXFXC0yDEeWq3vLHjGcNBiole5 3eN2gdmGeazLM0jpsJtZjDdCNhLkfKRCejV4BWTNAZRvwJjOmjFirZSqfdyBQwYB 0CCiLmc5UEdJI2F2tutc7aBhgRe8C/YyuRncDLVQdQeI/9lvq8UZxaIc4kpndnpx JiXZdJ/h6trDLE1lO7mpe5cI1jdddr+kMnuOO+rylTkZ+fr5YFhTPB3vusEmdOFw ==
- In-reply-to: <b96fd102-a60d-4ad6-831f-ea7fcd9f1011@www.fastmail.com>
- 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
- References: <b96fd102-a60d-4ad6-831f-ea7fcd9f1011@www.fastmail.com>
Daniel Shahaf wrote on Sat, 31 Aug 2019 20:19 +00:00:
> tl;dr: A change made to Subversion (upstream) trunk today affects _subversion.
Patch attached. I think it's fairly safe to commit it already, even
before the upstream release: it's unlikely that «svn help -v» will be
made to mean "grow a toaster's arm".
Cheers,
Daniel
From 474b54a1c97e4f7b81368e7b10b3b5b1fe359dd0 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Date: Sun, 1 Sep 2019 00:35:42 +0000
Subject: [PATCH 1/2] _subversion: Use 'svn help -v' to show global options,
experimental options, and experimental subcommands (upstream issue SVN-4828,
to be released in Subversion 1.13.0)
---
Completion/Unix/Command/_subversion | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index a066b0728..6d9178a2f 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -30,11 +30,24 @@ _svn () {
'1: :->cmds' \
'*:: :->args' && ret=0
+ local _svn_help_takes_verbose
+ if _cache_invalid svn-help-takes-verbose || ! _retrieve_cache svn-help-takes-verbose; then
+ if [[ $(_call_program svn-help-v svn help help) == *--verbose* ]]
+ _svn_help_takes_verbose=$(( ! $? ))
+ _store_cache svn-help-takes-verbose _svn_help_takes_verbose
+ fi
+ if (( _svn_help_takes_verbose )); then
+ readonly dash_v="-v"
+ else
+ readonly dash_v
+ fi
+ unset _svn_help_takes_verbose
+
if [[ -n $state ]] && (( ! $+_svn_cmds )); then
typeset -gHA _svn_cmds
if _cache_invalid svn-cmds || ! _retrieve_cache svn-cmds; then
_svn_cmds=(
- ${=${(f)${${"$(_call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z-]##)[[:space:]]#(\([a-z, ?-]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
+ ${=${(f)${${"$(_call_program commands svn help $dash_v)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z-]##)[[:space:]]#(\([a-z, ?-]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
)
if (( $? == 0 )); then
_store_cache svn-cmds _svn_cmds
@@ -60,14 +73,14 @@ _svn () {
if _cache_invalid svn-${cmd}-usage || \
! _retrieve_cache svn-${cmd}-usage;
then
- usage=${${(M)${(f)"$(_call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
+ usage=${${(M)${(f)"$(_call_program options svn help $dash_v -- $cmd)"}:#usage:*}#usage:*$cmd] }
_store_cache svn-${cmd}-usage usage
fi
if _cache_invalid svn-${cmd}-usage || \
! _retrieve_cache svn-${cmd}-args;
then
args=(
- ${=${${${(M)${(f)"$(_call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]}
+ ${=${${${(M)${(f)"$(_call_program options svn help $dash_v -- $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]}
)
while (( idx=$args[(I)*--accept:arg:] )); do
args[idx]=( --accept'=:automatic conflict resolution action:((working\:working base\:base recommended\:recommended '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' )
From 44b79f5937630c2d387f489356c90db174e4449e Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Sep 2019 02:47:19 +0000
Subject: [PATCH 2/2] _subversion: Update --show-item= completion to 1.12.0.
---
Completion/Unix/Command/_subversion | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 6d9178a2f..2c8085045 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -11,11 +11,14 @@ _svn () {
relative-url "the repository-relative URL"
repos-root-url "the repository root URL"
repos-uuid "the repository UUID"
+ repos-size "the size of TARGET in the repository (for files only)"
revision "the revision of TARGET"
last-changed-revision "the most recent revision in which TARGET was changed"
last-changed-date "the date of the last-changed revision"
last-changed-author "the author of the last-changed revision"
wc-root "the working copy root path"
+ schedule "'normal', 'add', 'delete', 'replace'"
+ depth "'infinity', 'immediates', 'files', 'empty', 'exclude'"
)
local update_policy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author