# HG changeset patch # User Brendan Cully # Date 1161926913 25200 # Node ID 6106236bc4eb4a5b2f3ad268136682b2e0cad175 # Parent 35b99f076d02bbd85e15c11f0caae4bfb8d91df4 zsh: support remote URLs diff -r 35b99f076d02 -r 6106236bc4eb contrib/zsh_completion --- a/contrib/zsh_completion Thu Oct 26 17:33:24 2006 -0700 +++ b/contrib/zsh_completion Thu Oct 26 22:28:33 2006 -0700 @@ -154,18 +154,34 @@ 'files:missing files:_hg_missing' } +_hg_urls() { + if compset -P bundle:// + then + _files + elif [[ -prefix *: ]] + then + _urls + else + local expl + compset -S '[^:]*' + _wanted url-schemas expl 'URL schema' compadd -S '' - \ + http:// https:// ssh:// bundle:// + fi +} + _hg_paths() { typeset -a paths pnames _hg_cmd paths 2> /dev/null | while read -A pnames do paths+=($pnames[1]) done - (( $#paths )) && _describe -t urls 'repository aliases' paths + (( $#paths )) && _describe -t path-aliases 'repository alias' paths } _hg_remote() { - _alternative 'urls:repository alias:_hg_paths' \ - 'directories:directory:_files -/' + _alternative 'path-aliases:repository alias:_hg_paths' \ + 'directories:directory:_files -/' \ + 'urls:URL schema:_hg_urls' } # Common options