Mercurial > hg-stable
annotate contrib/zsh_completion @ 3493:1b9494d2b070
zsh: expand tags lazily
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 24 Oct 2006 11:10:04 -0700 |
parents | 46958e428fcd |
children | 40fabb2a64b8 |
rev | line source |
---|---|
1362 | 1 #compdef hg |
2 | |
3 # Zsh completion script for mercurial. Rename this file to _hg and copy | |
4 # it into your zsh function path (/usr/share/zsh/site-functions for | |
5 # instance) | |
6 # | |
7 # Copyright (C) 2005 Steve Borho | |
8 # | |
9 # This is free software; you can redistribute it and/or modify it under | |
10 # the terms of the GNU General Public License as published by the Free | |
11 # Software Foundation; either version 2 of the License, or (at your | |
12 # option) any later version. | |
13 # | |
14 | |
15 local curcontext="$curcontext" state line | |
16 typeset -A opt_args | |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
17 local subcmds repos newFiles addedFiles includeExclude commitMessage |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
18 local _hg_state |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
19 |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
20 _hg_state () { |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
21 case "$state" in |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
22 (tags) |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
23 compadd $(hg tags 2> /dev/null | |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
24 sed -e 's/[0-9]*:[a-f0-9]*$//; s/ *$//') |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
25 ;; |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
26 (qapplied) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
27 compadd $(hg qapplied) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
28 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
29 (qunapplied) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
30 compadd $(hg qunapplied) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
31 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
32 esac |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
33 } |
1362 | 34 |
35 subcmds=($(hg -v help | sed -e '1,/^list of commands:/d' \ | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
36 -e '/^global options:/,$d' -e '/^ [^ ]/!d; s/[,:].*//g;')) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
37 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
38 # A lot of commands have these arguments |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
39 includeExclude=( |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
40 '*-I-[include names matching the given patterns]:dir:_files -W $(hg root) -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
41 '*--include-[include names matching the given patterns]:dir:_files -W $(hg root) -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
42 '*-X-[exclude names matching the given patterns]:dir:_files -W $(hg root) -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
43 '*--exclude-[exclude names matching the given patterns]:dir:_files -W $(hg root) -/') |
1362 | 44 |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
45 commitMessage=( |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
46 '(-m --message -l --logfile --edit)-e[edit commit message]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
47 '(-m --message -l --logfile -e)--edit[edit commit message]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
48 '(-e --edit -l --logfile --message)-m[use <text> as commit message]:message:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
49 '(-e --edit -l --logfile -m)--message[use <text> as commit message]:message:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
50 '(-e --edit -m --message --logfile)-l[read the commit message from <file>]:log file:_files' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
51 '(-e --edit -m --message -l)--logfile[read the commit message from <file>]:log file:_files') |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
52 |
1362 | 53 if [[ $service == "hg" ]]; then |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
54 _arguments -C -A "-*" \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
55 '(--repository)-R[repository root directory]:root:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
56 '(-R)--repository[repository root directory]:root:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
57 '--cwd[change working directory]:new working directory:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
58 '(--noninteractive)-y[do not prompt, assume yes for any required answers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
59 '(-y)--noninteractive[do not prompt, assume yes for any required answers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
60 '(--verbose)-v[enable additional output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
61 '(-v)--verbose[enable additional output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
62 '(--quiet)-q[suppress output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
63 '(-q)--quiet[suppress output]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
64 '(--help)-h[display help and exit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
65 '(-h)--help[display help and exit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
66 '--debug[debug mode]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
67 '--debugger[start debugger]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
68 '--traceback[print traceback on exception]' \ |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
69 '--time[time how long the command takes]' \ |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
70 '--profile[profile]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
71 '--version[output version information and exit]' \ |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
72 '*::command:->subcmd' && return 0 |
1362 | 73 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
74 if (( CURRENT == 1 )); then |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
75 _wanted commands expl 'hg command' compadd -a subcmds |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
76 return |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
77 fi |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
78 service="$words[1]" |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
79 curcontext="${curcontext%:*}=$service:" |
1362 | 80 fi |
81 | |
82 case $service in | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
83 (add) |
1484
840808c57969
zsh completion improvements.
Steve Borho <steve@borho.org>
parents:
1442
diff
changeset
|
84 newFiles=(${(ps:\0:)"$(hg status -0un .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
85 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
86 '*:file:->unknown' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
87 _wanted files expl 'unknown files' compadd -a newFiles |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
88 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
89 |
1362 | 90 (addremove) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
91 _arguments $includeExclude \ |
1362 | 92 '*:directories:_files -/' # assume they want to add/remove a dir |
93 ;; | |
94 | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
95 (forget) |
1484
840808c57969
zsh completion improvements.
Steve Borho <steve@borho.org>
parents:
1442
diff
changeset
|
96 addedFiles=(${(ps:\0:)"$(hg status -0an .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
97 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
98 '*:file:->added' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
99 _wanted files expl 'newly added files' compadd -a addedFiles |
1362 | 100 ;; |
101 | |
102 (remove|rm) | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
103 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
104 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
105 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
106 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
107 (copy|cp) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
108 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
109 '(--after)-A[record a copy that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
110 '(-A)--after[record a copy that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
111 '(--force)-f[forcibly copy over an existing managed file]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
112 '(-f)--force[forcibly copy over an existing managed file]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
113 '(--parents)-p[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
114 '(-p)--parents[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
115 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
116 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
117 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
118 (rename|mv) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
119 if (( CURRENT == 2 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
120 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
121 '(--after)-A[record a rename that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
122 '(-A)--after[record a rename that has already occurred]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
123 '(--force)-f[replace destination if it exists]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
124 '(-F)--force[replace destination if it exists]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
125 '(--parents)-p[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
126 '(-p)--parents[append source path to dest]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
127 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
128 else |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
129 _arguments '*:destination:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
130 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
131 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
132 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
133 (diff) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
134 _arguments $includeExclude \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
135 '*-r[revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
136 '*--rev[revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
137 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
138 '(-a)--text[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
139 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
140 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
141 |
1544
b3184bea3eb3
added st as alias for status in zsh_completition
Michael Gebetsroither <michael.geb@gmx.at>
parents:
1486
diff
changeset
|
142 (status|st) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
143 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
144 '(--no-status)-n[hide status prefix]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
145 '(-n)--no-status[hide status prefix]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
146 '(--print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
147 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
148 '(--modified)-m[show only modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
149 '(-m)--modified[show only modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
150 '(--added)-a[show only added files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
151 '(-a)--added[show only added files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
152 '(--removed)-r[show only removed files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
153 '(-r)--removed[show only removed files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
154 '(--unknown)-u[show only unknown files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
155 '(-u)--unknown[show only unknown files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
156 '*:search pattern, then files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
157 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
158 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
159 (revert) |
1484
840808c57969
zsh completion improvements.
Steve Borho <steve@borho.org>
parents:
1442
diff
changeset
|
160 addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"}) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
161 _arguments \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
162 '(--rev)-r[revision to revert to]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
163 '(-r)--rev[revision to revert to]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
164 '(--nonrecursive)-n[do not recurse into subdirectories]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
165 '(-n)--nonrecursive[do not recurse into subdirectories]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
166 '*:file:->modified' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
167 _wanted files expl 'mofified files' compadd -a addedFiles |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
168 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
169 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
170 (commit|ci) |
1484
840808c57969
zsh completion improvements.
Steve Borho <steve@borho.org>
parents:
1442
diff
changeset
|
171 addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"}) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
172 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
173 '(--addremove)-A[run addremove during commit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
174 '(-A)--addremove[run addremove during commit]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
175 '(--message)-m[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
176 '(-m)--message[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
177 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
178 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
179 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
180 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
181 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
182 '(-u)--user[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
183 '*:file:->modified' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
184 _wanted files expl 'mofified files' compadd -a addedFiles |
1362 | 185 ;; |
186 | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
187 (cat) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
188 _arguments $includeExclude \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
189 '(--output)-o[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
190 '(-o)--output[print output to file with formatted name]:filespec:' \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
191 '(--rev)-r[revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
192 '(-r)--rev[revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
193 '*:file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
194 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
195 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
196 (annotate) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
197 _arguments $includeExclude \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
198 '(--rev)-r[annotate the specified revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
199 '(-r)--rev[annotate the specified revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
200 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
201 '(-a)--text[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
202 '(--user)-u[list the author]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
203 '(-u)--user[list the author]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
204 '(--changeset)-c[list the changeset]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
205 '(-c)--changeset[list the changeset]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
206 '(--number)-n[list the revision number (default)]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
207 '(-n)--number[list the revision number (default)]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
208 '*:files:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
209 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
210 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
211 (grep) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
212 _arguments $includeExclude \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
213 '*-r[search in given revision range]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
214 '*--rev[search in given revision range]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
215 '--all[print all revisions with matches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
216 '(-print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
217 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
218 '(--ignore-case)-i[ignore case when matching]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
219 '(-i)--ignore-case[ignore case when matching]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
220 '(--files-with-matches)-l[print names of files and revs that match]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
221 '(-l)--files-with-matches[print names of files and revs that match]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
222 '(--line-number)-n[print matching line numbers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
223 '(-n)--line-number[print matching line numbers]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
224 '(--user)-u[print user who committed change]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
225 '(-u)--user[print user who committed change]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
226 '*:search pattern:' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
227 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
228 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
229 (locate) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
230 _arguments $includeExclude \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
231 '(--rev)-r[search repository as it stood at revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
232 '(-r)--rev[search repository as it stood at revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
233 '(--print0)-0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
234 '(-0)--print0[end filenames with NUL, for use with xargs]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
235 '(--fullpath)-f[print complete paths]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
236 '(-f)--fullpath[print complete paths]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
237 '*:search pattern:' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
238 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
239 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
240 (log|history) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
241 _arguments $includeExclude \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
242 '*-r[show the specified revision or range]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
243 '*--rev[show the specified revision or range]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
244 '(--no-merges -M --only-merges)-m[show only merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
245 '(--no-merges -M -m)--only-merges[show only merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
246 '(--only-merges -m --no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
247 '(--only-merges -m -M)--no-merges[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
248 '(--keyword)-k[search for a keyword]:keyword:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
249 '(-k)--keyword[search for a keyword]:keyword:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
250 '(--branch)-b[show branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
251 '(-b)--branch[show branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
252 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
253 '(-p)--patch[show patch]' \ |
1362 | 254 '*:file:_files' |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
255 ;; |
1362 | 256 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
257 (update|checkout|co) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
258 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
259 '(--branch)-b[checkout the head of a specific branch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
260 '(-b)--branch[checkout the head of a specific branch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
261 '(-C --clean --merge)-m[allow merging of branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
262 '(-C --clean -m)--merge[allow merging of branches]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
263 '(-m --merge --clean)-C[overwrite locally modified files]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
264 '(-m --merge -C)--clean[overwrite locally modified files]' \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
265 '*:revision or tag:->tags' |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
266 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
267 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
268 (tag) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
269 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
270 '(--local)-l[make the tag local]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
271 '(-l)--local[make the tag local]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
272 '(--message)-m[message for tag commit log entry]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
273 '(-m)--message[message for tag commit log entry]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
274 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
275 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
276 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
277 '(-u)--user[record user as commiter]:user:' \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
278 '*:name, then revision:->tags' |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
279 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
280 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
281 (clone) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
282 if (( CURRENT == 2 )); then |
1486
d7809d6e9db2
zsh: allow 'hg clone' to complete paths listed in ~/.hgrc
Steve Borho <steve@borho.org>
parents:
1484
diff
changeset
|
283 repos=( $(hg paths | sed -e 's/^.*= //') ) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
284 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
285 '(--no-update)-U[do not update the new working directory]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
286 '(-U)--no-update[do not update the new working directory]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
287 '(--ssh)-e[specify ssh command to use]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
288 '(-e)--ssh[specify ssh command to use]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
289 '--pull[use pull protocol to copy metadata]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
290 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
291 '*:local repo:_files -/' |
1486
d7809d6e9db2
zsh: allow 'hg clone' to complete paths listed in ~/.hgrc
Steve Borho <steve@borho.org>
parents:
1484
diff
changeset
|
292 _wanted source expl 'source repository' compadd -a repos |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
293 elif (( CURRENT == 3 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
294 _arguments '*:dest repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
295 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
296 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
297 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
298 (rawcommit) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
299 _arguments \ |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
300 '(--parent)-p[parent revision]:revision:->tags' \ |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
301 '(-p)--parent[parent revision]:revision:->tags' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
302 '(--date)-d[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
303 '(-d)--date[record datecode as commit date]:date code:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
304 '(--user)-u[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
305 '(-u)--user[record user as commiter]:user:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
306 '(--message)-m[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
307 '(-m)--message[use <txt> as commit message]:string:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
308 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
309 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
310 '(--files)-F[file list]:file list:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
311 '(-F)--files[file list]:file list:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
312 '*:files to commit:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
313 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
314 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
315 (bundle) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
316 if (( CURRENT == 2 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
317 _arguments '*:changegroup file:_files -g \*.hg' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
318 elif (( CURRENT == 3 )); then |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
319 _arguments '*:other repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
320 fi |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
321 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
322 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
323 (unbundle) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
324 _arguments '*:changegroup .hg file:_files -g \*.hg' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
325 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
326 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
327 (incoming) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
328 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
329 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
330 '(-p)--patch[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
331 '(--no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
332 '(-M)--no-merges[do not show merge revisions]' \ |
1442
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
333 '(--newest-first)-n[show newest record first]' \ |
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
334 '(-n)--newest-first[show newest record first]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
335 '*:mercurial repository:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
336 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
337 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
338 (import|patch) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
339 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
340 '(--strip)-p[directory strip option for patch (default: 1)]:count:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
341 '(-p)--strip[directory strip option for patch (default: 1)]:count:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
342 '(--force)-f[skip check for outstanding uncommitted changes]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
343 '(-f)--force[skip check for outstanding uncommitted changes]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
344 '(--base)-b[base directory to read patches from]:file:_files -W $(hg root) -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
345 '(-b)--base[base directory to read patches from]:file:_files -W $(hg root) -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
346 '*:patch file:_files' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
347 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
348 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
349 (pull) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
350 repos=( $(hg paths | sed -e 's/^.*= //') ) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
351 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
352 '(--update)-u[update working directory to tip after pull]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
353 '(-u)--update[update working directory to tip after pull]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
354 '(--ssh)-e[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
355 '(-e)--ssh[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
356 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
357 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
358 _wanted source expl 'source repository' compadd -a repos |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
359 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
360 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
361 (outgoing) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
362 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
363 '(--patch)-p[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
364 '(-p)--patch[show patch]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
365 '(--no-merges)-M[do not show merge revisions]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
366 '(-M)--no-merges[do not show merge revisions]' \ |
1442
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
367 '(--newest-first)-n[show newest record first]' \ |
d32dbf86b88d
zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents:
1438
diff
changeset
|
368 '(-n)--newest-first[show newest record first]' \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
369 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
370 _wanted source expl 'source repository' compadd -a repos |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
371 ;; |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
372 |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
373 (export) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
374 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
375 '(--outout)-o[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
376 '(-o)--output[print output to file with formatted name]:filespec:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
377 '(--text)-a[treat all files as text]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
378 '(-a)--text[treat all files as text]' \ |
1362 | 379 '*:revision:->revs' |
380 _wanted revs expl 'revision or tag' compadd -a tags | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
381 ;; |
1362 | 382 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
383 (push) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
384 repos=( $(hg paths | sed -e 's/^.*= //') ) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
385 _arguments \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
386 '(--force)-f[force push]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
387 '(-f)--force[force push]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
388 '(--ssh)-e[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
389 '(-e)--ssh[specify ssh command to use]:ssh command:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
390 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
391 '*:local repo:_files -/' |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
392 _wanted source expl 'source repository' compadd -a repos |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
393 ;; |
1362 | 394 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
395 (serve) |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
396 _arguments \ |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
397 '(--accesslog)-A[name of access log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
398 '(-A)--accesslog[name of access log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
399 '(--errorlog)-E[name of error log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
400 '(-E)--errorlog[name of error log file]:log file:_files' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
401 '(--port)-p[listen port]:listen port:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
402 '(-p)--port[listen port]:listen port:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
403 '(--address)-a[interface address]:interface address:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
404 '(-a)--address[interface address]:interface address:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
405 '(--name)-n[name to show in web pages]:repository name:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
406 '(-n)--name[name to show in web pages]:repository name:' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
407 '(--templates)-t[web template directory]:template dir:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
408 '(-t)--templates[web template directory]:template dir:_files -/' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
409 '--style[web template style]:style' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
410 '--stdio[for remote clients]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
411 '(--ipv6)-6[use IPv6 in addition to IPv4]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
412 '(-6)--ipv6[use IPv6 in addition to IPv4]' |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
413 ;; |
1362 | 414 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
415 (help) |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
416 _wanted commands expl 'hg command' compadd -a subcmds |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
417 ;; |
1362 | 418 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
419 (heads) |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
420 _arguments \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
421 '(--branches)-b[find branch info]' \ |
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
422 '(-b)--branches[find branch info]' |
1362 | 423 ;; |
424 | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
425 (paths) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
426 _arguments '*:symbolic name:(default default-push)' |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
427 ;; |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
428 |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
429 (init) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
430 _arguments '*:new repo directory:_files -/' |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
431 ;; |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
432 |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
433 (manifest) |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
434 _arguments '*:revision:->tags' |
1362 | 435 ;; |
436 | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
437 (parents) |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
438 _arguments '*:revision:->tags' |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
439 ;; |
1362 | 440 |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
441 (identify|recover|root|undo|view|verify|version|ct|tags) |
1362 | 442 # no arguments for these commands |
443 ;; | |
444 | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
445 # MQ commands |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
446 (qdel*|qrm|qrem*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
447 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
448 {-k,--keep}'[keep patch file]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
449 {-r,--rev}'[revision]:applied patch:->qapplied' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
450 '*:unapplied patches:->qunapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
451 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
452 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
453 (qnew) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
454 _arguments $commitMessage \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
455 {-f,--force}'[import uncommitted changes into patch]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
456 ':patch name:' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
457 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
458 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
459 (qpo*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
460 applied=( $(hg qapplied) ) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
461 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
462 (1){-a,--all}'[pop all patches]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
463 {-f,--force}'[forget any local changes]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
464 ':applied patch:->qapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
465 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
466 |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
467 (qpu*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
468 _arguments \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
469 (1){-a,--all}'[apply all patches]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
470 {-f,--force}'[apply if the patch has rejects]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
471 ':unapplied patch:->qunapplied' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
472 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
473 (qref*) |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
474 _arguments $commitMessage $includeExclude \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
475 {-g,--git}'[use git extended diff format]' \ |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
476 {-s,--short}'[short refresh]' |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
477 ;; |
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
478 |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
479 (*) |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
480 _message "unknown hg command completion: $service" |
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
481 ;; |
1362 | 482 esac |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
483 |
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
484 _hg_state |