zsh-users
 help / color / mirror / code / Atom feed
* Patch for completion with svn 1.5.0
@ 2008-01-30 13:37 Christopher Key
  2008-01-30 15:11 ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Key @ 2008-01-30 13:37 UTC (permalink / raw)
  To: zsh-users

The output of,
# svn help COMMAND
has changed slightly between 1.4.x and 1.5.0.  The attached patch deals
with this.

Regards,

Chris Key



--- Completion/Unix/Command/_subversion~        2007-03-19
13:02:49.000000000 +0000
+++ Completion/Unix/Command/_subversion 2008-01-30 12:12:48.000000000 +0000
@@ -30,7 +30,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help
$cmd)"}:#usage:*}#usage:*$cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help
$cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]])
\[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3]
(-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help
$cmd)"##*Valid options:}:#* :*}%% #:*}/
(?:arg|ARG)/:arg:}/(#b)-([[:alpha:]])
\[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3]
(-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-30 13:37 Patch for completion with svn 1.5.0 Christopher Key
@ 2008-01-30 15:11 ` Peter Stephenson
  2008-01-30 15:45   ` svn commit completion William Scott
  2008-01-31 12:40   ` Patch for completion with svn 1.5.0 Peter Stephenson
  0 siblings, 2 replies; 11+ messages in thread
From: Peter Stephenson @ 2008-01-30 15:11 UTC (permalink / raw)
  To: zsh-users

On Wed, 30 Jan 2008 13:37:54 +0000
Christopher Key <cjk32@cam.ac.uk> wrote:
> The output of,
> # svn help COMMAND
> has changed slightly between 1.4.x and 1.5.0.  The attached patch deals
> with this.

Thanks, this looks useful.  Your patch got line-wrapped half-way up Milton
Road, so I've reconstructed it slightly.  Does the following look right?
(It survived a half-hearted test.)

I also patched svnadmin help the same way; does this fix Vincent's problem?
(Again, it seemed to do something.)  I'm doing this from ignorance,
however, so if I've broken something I wouldn't know.

Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.24
diff -u -r1.24 _subversion
--- Completion/Unix/Command/_subversion	19 Apr 2007 20:37:04 -0000	1.24
+++ Completion/Unix/Command/_subversion	30 Jan 2008 15:10:08 -0000
@@ -30,7 +30,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;
@@ -148,7 +148,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
         if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
           args+=( ":path:_files -/" )

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 11+ messages in thread

* svn commit completion
  2008-01-30 15:11 ` Peter Stephenson
@ 2008-01-30 15:45   ` William Scott
  2008-01-31 15:41     ` Richard Hartmann
  2008-01-31 12:40   ` Patch for completion with svn 1.5.0 Peter Stephenson
  1 sibling, 1 reply; 11+ messages in thread
From: William Scott @ 2008-01-30 15:45 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

This reminds me that I wanted to ask a question about _svn:

With _cvs, the commit contextual completion offers only files that have
been touched since the last cvs update.  With _svn, it completes with
everything in the directory, instead of only what has changed.

Is that a limitation imposed by svn, or just a design difference?

Bill


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-30 15:11 ` Peter Stephenson
  2008-01-30 15:45   ` svn commit completion William Scott
@ 2008-01-31 12:40   ` Peter Stephenson
  2008-01-31 13:52     ` Christopher Key
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Stephenson @ 2008-01-31 12:40 UTC (permalink / raw)
  To: zsh-users; +Cc: Christopher Key

On Wed, 30 Jan 2008 15:11:33 +0000
Peter Stephenson <pws@csr.com> wrote:
> On Wed, 30 Jan 2008 13:37:54 +0000
> Christopher Key <cjk32@cam.ac.uk> wrote:
> > The output of,
> > # svn help COMMAND
> > has changed slightly between 1.4.x and 1.5.0.  The attached patch deals
> > with this.
> 
> Thanks, this looks useful.  Your patch got line-wrapped half-way up Milton
> Road, so I've reconstructed it slightly.  Does the following look right?
> (It survived a half-hearted test.)
> 
> I also patched svnadmin help the same way; does this fix Vincent's problem?
> (Again, it seemed to do something.)  I'm doing this from ignorance,
> however, so if I've broken something I wouldn't know.

A bit of probing suggests the following would be safer.  I'd like to get
this right before releasing 4.3.5 in the next day or two.

Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.24
diff -u -r1.24 _subversion
--- Completion/Unix/Command/_subversion	19 Apr 2007 20:37:04 -0000	1.24
+++ Completion/Unix/Command/_subversion	31 Jan 2008 12:37:34 -0000
@@ -30,7 +30,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG|arg)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;
@@ -148,7 +148,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG|arg)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
         if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
           args+=( ":path:_files -/" )


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-31 12:40   ` Patch for completion with svn 1.5.0 Peter Stephenson
@ 2008-01-31 13:52     ` Christopher Key
  2008-01-31 14:05       ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Key @ 2008-01-31 13:52 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 3403 bytes --]

Peter Stephenson wrote:
> On Wed, 30 Jan 2008 15:11:33 +0000
> Peter Stephenson <pws@csr.com> wrote:
>   
>> On Wed, 30 Jan 2008 13:37:54 +0000
>> Christopher Key <cjk32@cam.ac.uk> wrote:
>>     
>>> The output of,
>>> # svn help COMMAND
>>> has changed slightly between 1.4.x and 1.5.0.  The attached patch deals
>>> with this.
>>>       
>> Thanks, this looks useful.  Your patch got line-wrapped half-way up Milton
>> Road, so I've reconstructed it slightly.  Does the following look right?
>> (It survived a half-hearted test.)
>>
>> I also patched svnadmin help the same way; does this fix Vincent's problem?
>> (Again, it seemed to do something.)  I'm doing this from ignorance,
>> however, so if I've broken something I wouldn't know.
>>     
>
> A bit of probing suggests the following would be safer.  I'd like to get
> this right before releasing 4.3.5 in the next day or two.
>
> Index: Completion/Unix/Command/_subversion
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
> retrieving revision 1.24
> diff -u -r1.24 _subversion
> --- Completion/Unix/Command/_subversion	19 Apr 2007 20:37:04 -0000	1.24
> +++ Completion/Unix/Command/_subversion	31 Jan 2008 12:37:34 -0000
> @@ -30,7 +30,7 @@
>  
>          usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
>          args=(
> -          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
> +          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG|arg)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
>          )
>  
>          case $cmd in;
> @@ -148,7 +148,7 @@
>  
>          usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
>          args=(
> -          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
> +          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (?:arg|ARG|arg)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
>          )
>          if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
>            args+=( ":path:_files -/" )
>
>   
Apologies, I'm not actually subscribed the the zsh-users mailing list,
so have only just caught up on the prior emails via the archive.

I thought I'd tested this with the old version of svn, but hadn't
actually managed to (the command being called by the completion logic
was still version 1.5).  The ?: in the pattern is a perl thing to tell
it not store the result of the match grouped by the brackets, but would
appear not apply to shell scripting.  Instead, "arg" should be replaced
simply with "(arg|ARG)".  I've attached a patch for this.  There are a
few other oddities with svn 1.5 too, I'll have a look and see if I can
deal with any of them.

Regards,

Chris

[-- Attachment #2: zsh-4.3.4-svn15.patch --]
[-- Type: text/x-patch, Size: 1560 bytes --]

--- Completion/Unix/Command/_subversion~	2007-03-19 13:02:49.000000000 +0000
+++ Completion/Unix/Command/_subversion	2008-01-31 13:36:12.000000000 +0000
@@ -30,7 +30,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;
@@ -142,7 +142,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
         if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
           args+=( ":path:_files -/" )

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-31 13:52     ` Christopher Key
@ 2008-01-31 14:05       ` Peter Stephenson
  2008-01-31 16:09         ` Christopher Key
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Stephenson @ 2008-01-31 14:05 UTC (permalink / raw)
  To: Christopher Key, zsh-users

Christopher Key wrote:
> I thought I'd tested this with the old version of svn, but hadn't
> actually managed to (the command being called by the completion logic
> was still version 1.5).  The ?: in the pattern is a perl thing to tell
> it not store the result of the match grouped by the brackets, but would
> appear not apply to shell scripting.  Instead, "arg" should be replaced
> simply with "(arg|ARG)".  I've attached a patch for this.  There are a
> few other oddities with svn 1.5 too, I'll have a look and see if I can
> deal with any of them.

Thanks, I had to restore a space...

>          args=(
> -          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $
> cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z
> -]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$matc
> h[3]}
> +          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $
> cmd)"##*Valid options:}:#*:*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[-
                            ^ here, before the colon.
> -([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2
> ]$match[3]}
>          )

for "svnadmin help help" to work.  This was 1.4.4.  I got it simply by
copying from the svn help equivalent.  I don't know if this is correct
for other versions.  I don't really understand why, either, but it seems
to make everything happy.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: svn commit completion
  2008-01-30 15:45   ` svn commit completion William Scott
@ 2008-01-31 15:41     ` Richard Hartmann
  2008-01-31 16:55       ` Re[2]: " Vadim Zeitlin
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Hartmann @ 2008-01-31 15:41 UTC (permalink / raw)
  To: William Scott; +Cc: Peter Stephenson, zsh-users

On Jan 30, 2008 4:45 PM, William Scott <wgscott@chemistry.ucsc.edu> wrote:

> With _cvs, the commit contextual completion offers only files that have
> been touched since the last cvs update.  With _svn, it completes with
> everything in the directory, instead of only what has changed.

I noticed that as well, though I adapted my muscle memory to it.


> Is that a limit imposed by svn, or just a design difference?

As svn status will happily tell you which files have been changed and which
are not in the repo, it is probably an oversight, not a hard limit.


Richard


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-31 14:05       ` Peter Stephenson
@ 2008-01-31 16:09         ` Christopher Key
  2008-01-31 16:17           ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Key @ 2008-01-31 16:09 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2836 bytes --]

Peter Stephenson wrote:
> Christopher Key wrote:
>   
>> I thought I'd tested this with the old version of svn, but hadn't
>> actually managed to (the command being called by the completion logic
>> was still version 1.5).  The ?: in the pattern is a perl thing to tell
>> it not store the result of the match grouped by the brackets, but would
>> appear not apply to shell scripting.  Instead, "arg" should be replaced
>> simply with "(arg|ARG)".  I've attached a patch for this.  There are a
>> few other oddities with svn 1.5 too, I'll have a look and see if I can
>> deal with any of them.
>>     
>
> Thanks, I had to restore a space...
>
>   
>>          args=(
>> -          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $
>> cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z
>> -]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$matc
>> h[3]}
>> +          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $
>> cmd)"##*Valid options:}:#*:*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[-
>>     
>                             ^ here, before the colon.
>   
>> -([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2
>> ]$match[3]}
>>          )
>>     
>
> for "svnadmin help help" to work.  This was 1.4.4.  I got it simply by
> copying from the svn help equivalent.  I don't know if this is correct
> for other versions.  I don't really understand why, either, but it seems
> to make everything happy.
>
>   
I was just having a play at getting svnadmin help help to work, and had
come up with a different solution.  The innermost pattern substitution
look for "Valid options:" in the output from "svnadmin help $cmd", and
strips that out. The next substition removes any items *not* containing
":", whereas this should correctly remove anything not containing " :",
as it does for "svn help $cmd".

Now, when you run


#svnadmin help help
help (?, h): usage: svnadmin help [SUBCOMMAND...]

Describe the usage of this program or its subcommands.


the output doesn't contain the magic "Valid options", but neither does
any of it contain " :", so nothing gets passed to the substitution
looking for command line options.  This doesn't seem quite the correct
way to solve the problem though.  A better way seems to me to be to
refine the innermost substitution to removed everything up to and
including "Valid options:", or everything if "Valid options:" isn't
contained in the string.  The reason being that we're only interested in
trying to parse content following this phrase, and if it doesn't appear,
then it's not worth parsing anything.

The attached patch should achieve this, although I've only had about 2h
worth of experience with shell pattern substitutions, so it may not be
the best way!

Regards,

Chris

[-- Attachment #2: zsh-4.3.4-svn15_1.patch --]
[-- Type: text/x-patch, Size: 1573 bytes --]

--- Completion/Unix/Command/_subversion~	2007-03-19 13:02:49.000000000 +0000
+++ Completion/Unix/Command/_subversion	2008-01-31 15:59:48.000000000 +0000
@@ -30,7 +30,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;
@@ -142,7 +142,7 @@
 
         usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
         args=(
-          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
         if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
           args+=( ":path:_files -/" )

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-31 16:09         ` Christopher Key
@ 2008-01-31 16:17           ` Peter Stephenson
  2008-02-01 12:36             ` Vincent Lefevre
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Stephenson @ 2008-01-31 16:17 UTC (permalink / raw)
  To: Christopher Key, zsh-users

Christopher Key wrote:
> I was just having a play at getting svnadmin help help to work, and had
> come up with a different solution.

This seems reasonable and I've committed it.  Thanks.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re[2]: svn commit completion
  2008-01-31 15:41     ` Richard Hartmann
@ 2008-01-31 16:55       ` Vadim Zeitlin
  0 siblings, 0 replies; 11+ messages in thread
From: Vadim Zeitlin @ 2008-01-31 16:55 UTC (permalink / raw)
  To: zsh-users

On Thu, 31 Jan 2008 16:41:59 +0100 Richard Hartmann <richih.mailinglist@gmail.com> wrote:

RH> On Jan 30, 2008 4:45 PM, William Scott <wgscott@chemistry.ucsc.edu> wrote:
RH> 
RH> > With _cvs, the commit contextual completion offers only files that have
RH> > been touched since the last cvs update.  With _svn, it completes with
RH> > everything in the directory, instead of only what has changed.
RH> 
RH> I noticed that as well, though I adapted my muscle memory to it.
RH> 
RH> > Is that a limit imposed by svn, or just a design difference?
RH> 
RH> As svn status will happily tell you which files have been changed and which
RH> are not in the repo, it is probably an oversight, not a hard limit.

 Actually "svn ci" does complete only modified (or added, removed) files
here (zsh 4.3.2 under Debian Linux), but the problem is that these files
are remembered by the completer in a global _cache_svn_status variable
which is never updated. I don't really know what's the best way of fixing
it but for now I've just done "precmd() { unset _cache_svn_status }" and
"svn ci" completes correctly all the time and not just the first one.

 Regards,
VZ


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch for completion with svn 1.5.0
  2008-01-31 16:17           ` Peter Stephenson
@ 2008-02-01 12:36             ` Vincent Lefevre
  0 siblings, 0 replies; 11+ messages in thread
From: Vincent Lefevre @ 2008-02-01 12:36 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Christopher Key, zsh-users

On 2008-01-31 16:17:30 +0000, Peter Stephenson wrote:
> Christopher Key wrote:
> > I was just having a play at getting svnadmin help help to work, and had
> > come up with a different solution.
> 
> This seems reasonable and I've committed it.  Thanks.

It solves my problem. Thanks.

BTW, there's still the following minor problem: it doesn't support
the --quiet option of svn. Note: this option can be used only in
the following two cases:

  svn --version --quiet
  svn --quiet --version

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-02-01 12:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30 13:37 Patch for completion with svn 1.5.0 Christopher Key
2008-01-30 15:11 ` Peter Stephenson
2008-01-30 15:45   ` svn commit completion William Scott
2008-01-31 15:41     ` Richard Hartmann
2008-01-31 16:55       ` Re[2]: " Vadim Zeitlin
2008-01-31 12:40   ` Patch for completion with svn 1.5.0 Peter Stephenson
2008-01-31 13:52     ` Christopher Key
2008-01-31 14:05       ` Peter Stephenson
2008-01-31 16:09         ` Christopher Key
2008-01-31 16:17           ` Peter Stephenson
2008-02-01 12:36             ` Vincent Lefevre

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