[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: bash_completion - subversion add: svn ls/merge ^/<remote path>

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 14 Aug 2015 12:26:56 +0100

On 12 August 2015, Christian Ferbar wrote:
> with this patch
>
> svn ls ^/<tab><tab> and svn merge ^/<tab><tab>
>
> will list the remote directories.
>
> to get "svn ls ^/" to autocomplete the path export SVN_BASH_COMPL_EXT=urls has to be set, I don't know why this check is only in ls ...

Thank you, Chris. This is nice, but it could be much better...

Please can URL completion work on full URLs as well as on relative URLs?

Please can URL completion work for all relevant subcommands, not just
"ls" and "merge"?

Please can you declare the variables as "local" so they do not pollute
the user's environment when it executes:

- url="${BASH_REMATCH[2]}"
+ local url="${BASH_REMATCH[2]}"
etc.

I notice the script already guesses a full URL for a merge, in the
following way: in a WC with 'branches' in its URL, it returns a full
URL ending in 'trunk', and in a WC with 'trunk' in its URL, it returns
a full URL ending in 'branches/' [1]. It would be nice if your new
completion would be able to continue completing the path after
'branches/'.

[1] It currently adds a space after 'branches/', which we should
suppress like this:

@@ -440,6 +450,7 @@ _svn()
         elif [[ "$here" == */trunk* ]] ; then
           # we guess that it is a merge from a branch
           COMPREPLY=( $(compgen -W ${here/\/trunk*/\/branches\/} -- $cur ) )
+ compopt -o nospace
           return 0
         else
           # no se, let us suggest the repository root...

- Julian
Received on 2015-08-14 13:34:26 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.