From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9828 invoked from network); 2 Aug 2006 21:34:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Aug 2006 21:34:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 76161 invoked from network); 2 Aug 2006 21:34:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Aug 2006 21:34:35 -0000 Received: (qmail 16799 invoked by alias); 2 Aug 2006 21:34:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10570 Received: (qmail 16789 invoked from network); 2 Aug 2006 21:34:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Aug 2006 21:34:28 -0000 Received: (qmail 75027 invoked from network); 2 Aug 2006 21:34:28 -0000 Received: from mta08-winn.ispmail.ntl.com (HELO mtaout02-winn.ispmail.ntl.com) (81.103.221.48) by a.mx.sunsite.dk with SMTP; 2 Aug 2006 21:34:26 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20060802213425.NTOQ27023.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Wed, 2 Aug 2006 22:34:25 +0100 Received: from pwslaptop.csr.com ([81.107.41.155]) by aamtaout01-winn.ispmail.ntl.com with SMTP id <20060802213425.IDPA644.aamtaout01-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Wed, 2 Aug 2006 22:34:25 +0100 Date: Wed, 2 Aug 2006 22:34:21 +0100 From: Peter Stephenson To: zsh-users@sunsite.dk Subject: Re: autocompletion of file url's Message-Id: <20060802223421.a65ccae4.p.w.stephenson@ntlworld.com> In-Reply-To: <44D11FDF.5060000@sheffield.ac.uk> References: <44D11FDF.5060000@sheffield.ac.uk> X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.8.20; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 02 Aug 2006 22:57:51 +0100 Nathan Haigh wrote: > I've started using subversion a bit recently and it annoys the hell out > of me when you have to specify repositories etc with file urls since > autocompletion doesn't work. e.g. > > svn import tmp/myproject file:///path/to/my/svn/repo It looks like the completion function is still not all that sophisticated, so presumably no subversion user up to now has got to grips with the nitty gritty. Here's your chance to become a zsh completion wizard... The despatcher for subversion commands doesn't have an explicit entry for "import", so it tries to synthesize it from the help text and doesn't get it right. This adds an explicit entry. I'm guessing the first argument will usually be a directory, but that can be changed if not. The URL completion for the second argument is standard across the completion system and should be good enough for your purposes. Say if you come across any more problems; I only use subversion very occasionally (and the Perforce completion is a good deal more complete :-)) but it's an important thing to get right. I've added matching parentheses to the case statement because they looked nicer. Index: Completion/Unix/Command/_subversion =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v retrieving revision 1.19 diff -u -r1.19 _subversion --- Completion/Unix/Command/_subversion 12 Jul 2006 02:40:54 -0000 1.19 +++ Completion/Unix/Command/_subversion 2 Aug 2006 21:33:21 -0000 @@ -34,32 +34,38 @@ ) case $cmd in; - add) + (add) args+=( '*:file:_files -g "*(^e:_svn_controlled:)"' ) ;; - commit) + (commit) args+=( '*:file:_files -g "*(e:_svn_status:)"' ) ;; - delete) + (delete) args+=( '*:file:_files -g ".svn(/e:_svn_deletedfiles:)"' ) ;; - diff) + (diff) args+=( '*: : _alternative "files:file:_files -g \*\(e:_svn_status:\)" "urls:URL:_svn_urls"' ) ;; - help) + (help) args+=( '*::sub command:_svn_commands' ) + ;; + (import) + args+=( + '1:project directory:_files -/' + '2:import location: _alternative "files:file:_files" "urls:URL:_svn_urls"' + ) ;; - log) + (log) args+=( '1: : _alternative "files:file:_files -g \*\(e:_svn_controlled:\)" "urls:URL:_svn_urls"' '*:file:_files -g "*(e:_svn_controlled:)"' @@ -72,17 +78,17 @@ '*:path or url: _alternative "files:file:_files" "urls:URL:_svn_urls"' ) ;; - resolved) + (resolved) args+=( '*:file:_files -g "*(e:_svn_conflicts:)"' ) ;; - revert) + (revert) args+=( '*:file:_files -g "(.svn|*)(/e:_svn_deletedfiles:,e:_svn_status:)"' ) ;; - *) + (*) case $usage in *(SRC|DST|TARGET|URL*PATH)*) args+=( -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/