zsh-users
 help / color / mirror / code / Atom feed
* SVN completion problem
@ 2005-08-04  7:19 Adam Piatyszek
  2005-08-04 10:26 ` Oliver Kiddle
  2005-08-08  2:03 ` Vincent Lefevre
  0 siblings, 2 replies; 7+ messages in thread
From: Adam Piatyszek @ 2005-08-04  7:19 UTC (permalink / raw)
  To: zsh-users

Hi!

I have a question about zsh completion for `svn' command (Subversion
program). Is it possible to use the completion not only for commands and
switches of this program but also for filename/directory arguments?

Now it works only for commands, e.g.:

% svn s<TAB>
status switch

% svn status <TAB>
--config-dir       --non-recursive    --username         -v
--no-auth-cache    --password         --verbose          
--no-ignore        --quiet            -N                 
--non-interactive  --show-updates     -q 

But:

% svn status some/path/f<TAB>

does not work.

Any hints appreciated!

/ediap


-- 
-=#=-  Adam Piątyszek - "ediap"    -=#=-  Liunx ID: #204648         -=#=-
-=#=-  ediap (at) et.put.poznan.pl -=#=-  JID: ediap (at) chrome.pl -=#=-
-=#=-  http://ediap.prv.pl/        -=#=-  Gadu-Gadu: 1157376        -=#=-
-=#=-  PGP key ID: 0x341E22F0      -=#=-  ICQ: 3303291              -=#=-


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

* Re: SVN completion problem
  2005-08-04  7:19 SVN completion problem Adam Piatyszek
@ 2005-08-04 10:26 ` Oliver Kiddle
  2005-08-04 10:50   ` Adam Piatyszek
  2005-08-08  2:03 ` Vincent Lefevre
  1 sibling, 1 reply; 7+ messages in thread
From: Oliver Kiddle @ 2005-08-04 10:26 UTC (permalink / raw)
  To: Adam Piatyszek; +Cc: zsh-users

Adam Piatyszek wrote:
> I have a question about zsh completion for `svn' command (Subversion
> program). Is it possible to use the completion not only for commands and
> switches of this program but also for filename/directory arguments?

It should be and it works for me so something else must be going wrong.

The completion for svn is largely driven by the output of the `svn help'
command. This makes it a little sensitive to changes in the format of
that output. What version of subversion have you got? What does `svn
help status' output? Here the second line is "usage: status [PATH...]".
On finding *PATH* in that, the svn completion should complete filenames.

Another way of trying to find out what is going wrong is to invoke the
_complete_debug widget: instead of pressing <tab>, press <ctrl-x><?>.

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


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

* Re: SVN completion problem
  2005-08-04 10:26 ` Oliver Kiddle
@ 2005-08-04 10:50   ` Adam Piatyszek
  2005-08-04 11:51     ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Piatyszek @ 2005-08-04 10:50 UTC (permalink / raw)
  To: zsh-users; +Cc: Oliver Kiddle

* Oliver Kiddle <okiddle@yahoo.co.uk> [04.08.2005 12:26]:

[...]

> It should be and it works for me so something else must be going wrong.

> The completion for svn is largely driven by the output of the `svn help'
> command. This makes it a little sensitive to changes in the format of
> that output. What version of subversion have you got? What does `svn
> help status' output? Here the second line is "usage: status [PATH...]".
> On finding *PATH* in that, the svn completion should complete filenames.

OK. I think I can now guess the reason. This is probably due to
translation of `svn help status' output in my locale (pl_PL):

#v+
ediap@lespaul burn % svn help status
status (stat, st): Podaj stan plików i katalogów w ramach kopii roboczej.
Wykorzystanie: status [ŚCIEŻKA...]
#v-

As you can see, the *PATH* is translated into Polish, so the completion
does not recognise it.

Where are the completion definitions for Subversion written (in which
file)?

Any proposals to make it working for other locale settings?

/ediap

-- 
-=#=-  Adam Piątyszek - "ediap"    -=#=-  Liunx ID: #204648         -=#=-
-=#=-  ediap (at) et.put.poznan.pl -=#=-  JID: ediap (at) chrome.pl -=#=-
-=#=-  http://ediap.prv.pl/        -=#=-  Gadu-Gadu: 1157376        -=#=-
-=#=-  PGP key ID: 0x341E22F0      -=#=-  ICQ: 3303291              -=#=-


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

* Re: SVN completion problem
  2005-08-04 10:50   ` Adam Piatyszek
@ 2005-08-04 11:51     ` Peter Stephenson
  2005-08-04 12:01       ` Adam Piatyszek
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2005-08-04 11:51 UTC (permalink / raw)
  To: zsh-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1334 bytes --]

Adam Piatyszek wrote:
> OK. I think I can now guess the reason. This is probably due to
> translation of `svn help status' output in my locale (pl_PL):
> 
> #v+
> ediap@lespaul burn % svn help status
> status (stat, st): Podaj stan plików i katalogów w ramach kopii roboczej.
> Wykorzystanie: status [¦CIE¯KA...]
> #v-
> 
> As you can see, the *PATH* is translated into Polish, so the completion
> does not recognise it.
> 
> Where are the completion definitions for Subversion written (in which
> file)?
> 
> Any proposals to make it working for other locale settings?

In the latest version svn already gets called with LC_MESSAGES=C to
work around this.  Do you have an old version?  The file in the
source bundle is Completion/Unix/Command/_subversion.

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: SVN completion problem
  2005-08-04 11:51     ` Peter Stephenson
@ 2005-08-04 12:01       ` Adam Piatyszek
  2005-08-04 12:13         ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Piatyszek @ 2005-08-04 12:01 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

* Peter Stephenson <pws@csr.com> [04.08.2005 13:51]:
> In the latest version svn already gets called with LC_MESSAGES=C to
> work around this.  Do you have an old version?  The file in the
> source bundle is Completion/Unix/Command/_subversion.

My zsh version is:

#v+
ediap@lespaul ~ % qpkg -I -v zsh
app-shells/zsh-4.2.5 *
#v-

It seems that it is the latest stable release denoted in
http://zsh.sunsite.dk/News/

OK. I managed to fix the `_subversion' file by adding LC_ALL=C and now
it works...

Here is a patch:

#v+
--- _subversion	2005-08-04 13:50:29.000000000 +0200
+++ _subversion.new	2005-08-04 13:53:54.000000000 +0200
@@ -64,10 +64,10 @@
 _svn_subcommand () {
   local subcmd _svn_subcmds _svn_subcmd_usage
 
-  _svn_subcmd_usage=${${(M)${(f)"$(_call_program options svn help $1)"}:#usage:*}#usage: $1 }
+  _svn_subcmd_usage=${${(M)${(f)"$(_call_program options LC_ALL=C svn help $1)"}:#usage:*}#usage: $1 }
 
   _svn_subcmds=(
-    ${${=${${${(M)${(f)"$(_call_program options svn help $1)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
+    ${${=${${${(M)${(f)"$(_call_program options LC_ALL=C svn help $1)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
   )
 
   case $1 in;
@@ -108,7 +108,7 @@
   if (( ! $+_svnadmin_cmds )); then
     typeset -gA _svnadmin_cmds
     _svnadmin_cmds=(
-      ${=${(f)${${"$(_call_program commands svnadmin help)"#l#*Available subcommands:}}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
+      ${=${(f)${${"$(_call_program commands LC_ALL=C svnadmin help)"#l#*Available subcommands:}}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
     )
   fi
 
@@ -131,10 +131,10 @@
 _svnadmin_subcommand () {
   local subcmd _svnadmin_subcmds _svnadmin_subcmd_usage
 
-  _svnadmin_subcmd_usage=${${(M)${(f)"$(_call_program options svnadmin help $1)"}:#$1: usage:*}#$1: usage: svnadmin $1 }
+  _svnadmin_subcmd_usage=${${(M)${(f)"$(_call_program options LC_ALL=C svnadmin help $1)"}:#$1: usage:*}#$1: usage: svnadmin $1 }
 
   _svnadmin_subcmds=(
-    ${${=${${${(M)${(f)"$(_call_program options svnadmin help $1)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
+    ${${=${${${(M)${(f)"$(_call_program options LC_ALL=C svnadmin help $1)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
   )
 
   [[ "$_svnadmin_subcmd_usage" == *REPOS_PATH* ]] &&

#v-

Thanks for your help!

/ediap

-- 
-=#=-  Adam Piątyszek - "ediap"    -=#=-  Liunx ID: #204648         -=#=-
-=#=-  ediap (at) et.put.poznan.pl -=#=-  JID: ediap (at) chrome.pl -=#=-
-=#=-  http://ediap.prv.pl/        -=#=-  Gadu-Gadu: 1157376        -=#=-
-=#=-  PGP key ID: 0x341E22F0      -=#=-  ICQ: 3303291              -=#=-


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

* Re: SVN completion problem
  2005-08-04 12:01       ` Adam Piatyszek
@ 2005-08-04 12:13         ` Peter Stephenson
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2005-08-04 12:13 UTC (permalink / raw)
  To: zsh-users

I've copied the lastest version of _subversion to the 2.4 branch; that
should make the problems go away.  (I don't think there are API changes
that would make this inadvisable.)

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: SVN completion problem
  2005-08-04  7:19 SVN completion problem Adam Piatyszek
  2005-08-04 10:26 ` Oliver Kiddle
@ 2005-08-08  2:03 ` Vincent Lefevre
  1 sibling, 0 replies; 7+ messages in thread
From: Vincent Lefevre @ 2005-08-08  2:03 UTC (permalink / raw)
  To: zsh-users

On 2005-08-04 09:19:23 +0200, Adam Piatyszek wrote:
> % svn s<TAB>
> status switch

BTW, "svn help s<TAB>" doesn't work: it doesn't try to complete to
anything.

-- 
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 / SPACES project at LORIA


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

end of thread, other threads:[~2005-08-08  2:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-04  7:19 SVN completion problem Adam Piatyszek
2005-08-04 10:26 ` Oliver Kiddle
2005-08-04 10:50   ` Adam Piatyszek
2005-08-04 11:51     ` Peter Stephenson
2005-08-04 12:01       ` Adam Piatyszek
2005-08-04 12:13         ` Peter Stephenson
2005-08-08  2:03 ` 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).