Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#299950: zsh: Better completion for "svn revert"



On 2005-03-26 19:36:52 -0500, Clint Adams wrote:
> +(( $+functions[_svn_adm_files] )) ||
> +_svn_adm_files() {
> +  compadd ${${(M)${(f)"$(svn status)"}:#(#s)[ADM]*}##[ADM] ##}

Doing a recursive "svn status" is not a good idea, as it may take
a very long time. I suggest doing a "svn -N status" and completing
also on any directory containing a .svn subdirectory.

Moreover, the [ADM] pattern is incorrect. It should be ([ADM]|?M).
This would give:

  compadd ${${(M)${(f)"$(svn -N status)"}:#(#s)([ADM]|?M)*}##([ADM]|?M) ##}

+ the code to complete on directories (only those that contain a
.svn subdirectory, in fact).

When one tries to complete on

  svn revert path/to/dir/

zsh should do a "svn -N status path/to/dir", which returns lines like

A     path/to/dir/added_file
D     path/to/dir/deleted_file
M     path/to/dir/modified_file
 M    path/to/dir/modifprop_file

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - 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



Messages sorted by: Reverse Date, Date, Thread, Author