Merge lp:~gagern/bzr/bug560030-drop-zsh-completion into lp:bzr

Proposed by Martin von Gagern on 2010-05-25
Status: Merged
Approved by: Robert Collins on 2010-05-31
Approved revision: 5242
Merged at revision: 5273
Proposed branch: lp:~gagern/bzr/bug560030-drop-zsh-completion
Merge into: lp:bzr
Diff against target: 359 lines (+23/-316)
3 files modified
NEWS (+4/-0)
contrib/zsh/README (+19/-0)
contrib/zsh/_bzr (+0/-316)
To merge this branch: bzr merge lp:~gagern/bzr/bug560030-drop-zsh-completion
Reviewer Review Type Date Requested Status
Robert Collins (community) 2010-05-25 Needs Fixing on 2010-05-26
Review via email: mp+25955@code.launchpad.net

Commit Message

Drop unmaintained zsh completion script.

Description of the Change

Drop the outdated zsh completion script, and add a README suggesting alternatives.

To post a comment you must log in.
Robert Collins (lifeless) wrote :

looks good.

Robert Collins (lifeless) wrote :

This needs a NEWS entry I think. If you could do that, and add a commit message to the merge proposal, it should be good to go.

review: Needs Fixing
5242. By Martin von Gagern on 2010-05-28

Added NEWS item about removed zsh completion script.

The NEWS item is classified under "Compatibility Breaks" for lack of a
better category. That fits because the change might break compatibiolity
with some installations or packaging specifications that rely on the zsh
script.

Robert Collins (lifeless) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-05-28 03:56:25 +0000
3+++ NEWS 2010-05-28 11:59:33 +0000
4@@ -80,6 +80,10 @@
5 construction if there is no __doc__ set. (Note, this will be reverted in
6 2.2b4) (Robert Collins)
7
8+* The source tree no longer contains a contrib/zsh/_bzr completion
9+ script. The new file contrib/zsh/README suggests alternatives.
10+ (Martin von Gagern, #560030)
11+
12 New Features
13 ************
14
15
16=== added file 'contrib/zsh/README'
17--- contrib/zsh/README 1970-01-01 00:00:00 +0000
18+++ contrib/zsh/README 2010-05-28 11:59:33 +0000
19@@ -0,0 +1,19 @@
20+This directory used to contain a shell completion function for zsh.
21+That script has been unmaintained since 2005, though. Zsh itself does
22+ship a _bzr completion function, and has done so for quite some time
23+now. So we suggest you use the version installed with your zsh
24+instead of the version that used to be located in this directory.
25+
26+Note that the shell-complete builtin of bzr does provide completion
27+information in a style suitable for zsh. There are some completion
28+scripts for zsh in the wild that make use of this feature, although
29+none of these scripts is officially supported by the bzr developers.
30+
31+Also note that recent versions of bzr (starting with the 2.3 series)
32+do include a bash_completion plugin. It should be possible to improve
33+this in such a way that it generates code for zsh instead of bash. So
34+if you want better zsh completion, this might be the place to start.
35+
36+References:
37+https://bugs.launchpad.net/bzr/+bug/560030
38+http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=history;f=Completion/Unix/Command/_bzr
39
40=== removed file 'contrib/zsh/_bzr'
41--- contrib/zsh/_bzr 2005-11-18 08:10:07 +0000
42+++ contrib/zsh/_bzr 1970-01-01 00:00:00 +0000
43@@ -1,316 +0,0 @@
44-#compdef bzr
45-
46-# Rudimentary zsh completion support for bzr.
47-
48-# -S means there are no options after a -- and that argument is ignored
49-
50-# To use this you must arrange for it to be in a directory that is on
51-# your $fpath, and also for compinit to be run. I don't understand
52-# how to get zsh to reload this file when it changes, other than by
53-# starting a new zsh.
54-
55-local _bzr_subcommands expl curcontext="$curcontext" state line
56-local bzrRoot helpArgs parentFile
57-typeset -A opt_args
58-
59-helpArgs=( '(--help)-h[show help message]' '(-h)--help[show help message]' )
60-bzrRoot=$(bzr root 2> /dev/null)
61-parentFile=$bzrRoot/.bzr/parent
62-
63-if [[ $service == "bzr" ]]; then
64- _arguments -C -A "-*" \
65- '*::command:->subcmd' && return 0
66-
67- if (( CURRENT == 1 )); then
68- _bzr_subcommands=(${(f)"$(_call_program bzr bzr shell-complete)"})
69- _describe -t subcommand 'subcommand' _bzr_subcommands
70- return
71- fi
72-
73- service="$words[1]"
74- curcontext="${curcontext%:*}=$service:"
75-fi
76-
77-_unknownFiles() {
78- local fileList;
79- fileList=(${(ps:\0:)"$(bzr ls --null --unknown)"})
80- compadd -af fileList
81- return 0
82-}
83-
84-_unknownRoot() {
85- local fileList;
86- fileList=(${(ps:\0:)"$(bzr ls --null --from-root --unknown)"})
87- compadd -af fileList
88- return 0
89-}
90-
91-_versionedFiles() {
92- local fileList;
93- fileList=(${(ps:\0:)"$(bzr ls --null --versioned)"})
94- compadd -af fileList
95- return 0
96-}
97-
98-case $service in
99- (add)
100- _arguments $helpArgs \
101- '--no-recurse[do not recurse into subdirectories]' \
102- '(-q)--quiet' \
103- '(--quiet)-q' \
104- '*:unknown files:_unknownFiles'
105- ;;
106-
107- (annotate|praise|blame)
108- _arguments $helpArgs '*:files:_versionedFiles'
109- ;;
110-
111- (clone|branch|get)
112- if (( CURRENT == 2 )); then
113- _arguments $helpArgs \
114- '(-r)--revision:rev:' \
115- '(--revision)-r:rev:' \
116- '--basis[specify basis branch]:basis:' \
117- '*:FROM_LOCATION:_files -/'
118- elif (( CURRENT == 3 )); then
119- _arguments $helpArgs \
120- '(-r)--revision:rev:' \
121- '(--revision)-r:rev:' \
122- '--basis[specify basis branch]:basis:' \
123- '*:TO_LOCATION:_files -/'
124- fi
125- ;;
126-
127- (rename|mv)
128- if (( CURRENT == 2 )); then
129- _arguments $helpArgs '*:old name:_versionedFiles'
130- else
131- _arguments $helpArgs '*:new name:'
132- fi
133- ;;
134-
135- (cat)
136- _arguments $helpArgs \
137- '(-r)--revision:rev:' \
138- '(--revision)-r:rev:' \
139- '*:file:_versionedFiles'
140- ;;
141-
142- (root)
143- _arguments $helpArgs '*:file:_files'
144- ;;
145-
146- (log)
147- _arguments $helpArgs \
148- '(-r)--revision[revision or range]:rev or rev range:' \
149- '(--revision)-r[revision or range]:rev or rev range:' \
150- '(--verbose)-v[show revision manifest]' \
151- '(-v)--verbose[show revision manifest]' \
152- '(--short --long)-l[use long format (default)]' \
153- '(--short -l)--long[use long format (default)]' \
154- '(-l --long)--short[use short format]' \
155- '(--message)-m[specify regexp]:regexp:' \
156- '(-m)--message[specify regexp]:regexp:' \
157- '--show-ids[show file IDs]' \
158- '--forward[reverse direction of revisions]' \
159- '--timezoe[specify timezone for dates]:timezone:' \
160- '*:file:_versionedFiles'
161- ;;
162-
163- (resolve)
164- _arguments $helpArgs '--all' '*:file:_versionedFiles'
165- ;;
166-
167- (status|st|stat)
168- _arguments $helpArgs \
169- '--all[include unchanged versioned files]' \
170- '--show-ids[show file IDs]' \
171- '*:file:_versionedFiles'
172- ;;
173-
174- (check)
175- _arguments $helpArgs \
176- '(--verbose)-v' \
177- '(-v)--verbose' \
178- '*:DIR:_files -/'
179- ;;
180-
181- (mkdir|upgrade|renames)
182- _arguments $helpArgs '*:DIR:_files -/'
183- ;;
184-
185- (remove|rm)
186- _arguments $helpArgs \
187- '(--verbose)-v' \
188- '(-v)--verbose' \
189- '*:file:_versionedFiles'
190- ;;
191-
192- (pull)
193- _arguments $helpArgs \
194- '--remember[Remember the specified location as a default]' \
195- '--overwrite[Ignore differences, overwrite unconditionally]' \
196- '*:local repository:_files -/'
197- [[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
198- ;;
199-
200- (missing|miss|mis)
201- _arguments $helpArgs \
202- '(--verbose -q --quiet)-v' \
203- '(-v -q --quiet)--verbose' \
204- '(--verbose -v --quiet)-q' \
205- '(-v -q --verbose)--quiet' \
206- '*:local repository:_files -/'
207- [[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
208- ;;
209-
210- (commit|checkin|ci)
211- _arguments $helpArgs \
212- '(--message)-m[commit message]:message text:' \
213- '(-m)--message[commit message]:message text:' \
214- '(--file)-F[commit message from file]:message file:' \
215- '(-F)--file[commit message from file]:message file:' \
216- '--unchanged[include unchanged files]' \
217- '(--verbose)-v' \
218- '(-v)--verbose' \
219- '*:modified files:_versionedFiles'
220- ;;
221-
222- (conflicts|added|deleted|modified|unknowns|directories|ignored)
223- _arguments $helpArgs
224- ;;
225-
226- (revno|init|version)
227- _arguments $helpArgs
228- ;;
229-
230- (whoami)
231- _arguments $helpArgs '--email[only show e-mail address]'
232- ;;
233-
234- (inventory)
235- _arguments $helpArgs \
236- '(-r)--revision[show inventory of a revision]:revision:' \
237- '(--revision)-r[show inventory of a revision]:revision:' \
238- '--show-ids[show file IDs]'
239- ;;
240-
241- (diff|dif|di)
242- _arguments $helpArgs \
243- '(-r)--revision:revision:' \
244- '(--revision)-r:revision:' \
245- '--diff-options[options to pass to gdiff]:diff options:' \
246- '*:files:_files'
247- ;;
248-
249- (export)
250- _arguments $helpArgs \
251- '(-r)--revision:revision:' \
252- '(--revision)-r:revision:' \
253- '--format=[format of exported file]:format:(dir tar tgz tbz2)' \
254- '--root[root directory of patch]:_files -/' \
255- '*:destination:_files'
256- ;;
257-
258- (ignore)
259- _arguments $helpArgs '*:NAME_PATTERN:_unknownRoot'
260- ;;
261-
262- (info)
263- _arguments $helpArgs '*:branch:_files -/'
264- ;;
265-
266- (testament)
267- _arguments $helpArgs \
268- '(-r)--revision:revision:' \
269- '(--revision)-r:revision:' \
270- '(--long)-l' \
271- '(-l)--long' \
272- '*:branch:_files -/'
273- ;;
274-
275- (revert|merge-revert)
276- _arguments $helpArgs \
277- '(-r)--revision:revision:' \
278- '(--revision)-r:revision:' \
279- '--no-backup[skip generation of backup~ files]' \
280- '*:file:_versionedFiles'
281- ;;
282-
283- (merge)
284- _arguments $helpArgs \
285- '(-r)--revision:revision:' \
286- '(--revision)-r:revision:' \
287- '--reprocess[Reprocess to reduce spurious conflicts]' \
288- '--show-base[Show base revision text in conflicts]' \
289- '--force[ignore uncommitted changes]' \
290- '--merge-type:merge type:(diff3 merge3 weave)' \
291- '*:local repository:_files -/'
292- [[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
293- ;;
294-
295- (ls)
296- _arguments $helpArgs \
297- '(--verbose)-v[display more information]' \
298- '(-v)--verbose[display more information]' \
299- '(-r)--revision:revision:' \
300- '(--revision)-r:revision:' \
301- '--from-root[Print all paths from the root of the branch]' \
302- '--non-recursive[Do not recurse into subdirectories]' \
303- '--null[Null separate the files]' \
304- '--ignored[Print ignored files]' \
305- '--unknown[Print unknown files]' \
306- '--versioned[Print versioned files]'
307- ;;
308-
309- (move)
310- if (( CURRENT == 2 )); then
311- _arguments $helpArgs '*:files:_versionedFiles'
312- else
313- _arguments '*:destination dir:_files -/'
314- fi
315- ;;
316-
317- (help)
318- _bzr_subcommands=(${(f)"$(_call_program bzr bzr shell-complete)"})
319- _arguments $helpArgs \
320- '(--long)-l' \
321- '(-l)--long' \
322- '*:subcmds:->cmds'
323- _describe -t subcommand 'subcommand' _bzr_subcommands
324- ;;
325-
326- # Plugins
327-
328- (visualize|visualise|viz|vis)
329- _arguments $helpArgs \
330- '(-r)--revision[starting revision]:rev:' \
331- '(--revision)-r[starting revision]:rev:'
332- ;;
333-
334- (gannotate|gblame|gpraise)
335- _arguments $helpArgs \
336- '--all[show annotations on all lines]' \
337- '--plain[do not hightlight annotation lines]' \
338- '*:files:_versionedFiles'
339- ;;
340-
341- (push)
342- _arguments $helpArgs \
343- '--overwrite[Ignore differences, overwrite unconditionally]' \
344- '*:local repository:_files -/'
345- [[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
346- ;;
347-
348- (clean-tree)
349- _arguments $helpArgs \
350- '--dry-run[show files to delete instead of deleting them]' \
351- '--ignored[delete all ignored files]' \
352- '--detritus[delete conflict files, merge backups, failed self-tests, *~, *.tmp, etc]'
353- ;;
354-
355-
356- (*)
357- _message "unknown bzr command completion: $service"
358- ;;
359-esac