annotate .zfun/_hg @ 77:45d7441d0cf2

Modularize .emacs
author Augie Fackler <durin42@gmail.com>
date Thu, 09 Apr 2009 13:39:20 -0500
parents 0ba810271408
children e5a40e768cf8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 #compdef hg
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 # Zsh completion script for mercurial. Rename this file to _hg and copy
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4 # it into your zsh function path (/usr/share/zsh/site-functions for
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 # instance)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6 #
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7 # Copyright (C) 2005-6 Steve Borho
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 # Copyright (C) 2006-8 Brendan Cully <brendan@kublai.com>
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 #
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 # This is free software; you can redistribute it and/or modify it under
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 # the terms of the GNU General Public License as published by the Free
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 # Software Foundation; either version 2 of the License, or (at your
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 # option) any later version.
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15 emulate -LR zsh
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 setopt extendedglob
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
17
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
18 local curcontext="$curcontext" state line
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19 typeset -A _hg_cmd_globals
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
20
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 _hg() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
22 local cmd _hg_root
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
23 integer i=2
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 _hg_cmd_globals=()
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
25
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
26 while (( i < $#words ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
28 case "$words[$i]" in
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
29 -R|--repository)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
30 eval _hg_root="$words[$i+1]"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
31 _hg_cmd_globals+=("$words[$i]" "$_hg_root")
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
32 (( i += 2 ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
33 continue
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
35 -R*)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
36 _hg_cmd_globals+="$words[$i]"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
37 eval _hg_root="${words[$i]#-R}"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
38 (( i++ ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
39 continue
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
40 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
41 --cwd|--config)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
42 # pass along arguments to hg completer
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
43 _hg_cmd_globals+=("$words[$i]" "$words[$i+1]")
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
44 (( i += 2 ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
45 continue
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
46 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
47 -*)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
48 # skip option
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
49 (( i++ ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
50 continue
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
51 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
52 esac
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
53 if [[ -z "$cmd" ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
54 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
55 cmd="$words[$i]"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
56 words[$i]=()
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
57 (( CURRENT-- ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
58 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
59 (( i++ ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
60 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
61
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
62 if [[ -z "$cmd" ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
63 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
64 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
65 ':mercurial command:_hg_commands'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
66 return
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
67 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
68
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
69 # resolve abbreviations and aliases
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
70 if ! (( $+functions[_hg_cmd_${cmd}] ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
71 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
72 local cmdexp
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
73 (( $#_hg_cmd_list )) || _hg_get_commands
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
74
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
75 cmdexp=$_hg_cmd_list[(r)${cmd}*]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
76 if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
77 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
78 # might be nice to rewrite the command line with the expansion
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
79 cmd="$cmdexp"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
80 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
81 if [[ -n $_hg_alias_list[$cmd] ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
82 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
83 cmd=$_hg_alias_list[$cmd]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
84 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
85 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
86
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
87 curcontext="${curcontext%:*:*}:hg-${cmd}:"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
88
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
89 zstyle -s ":completion:$curcontext:" cache-policy update_policy
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
90
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
91 if [[ -z "$update_policy" ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
92 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
93 zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
94 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
95
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
96 if (( $+functions[_hg_cmd_${cmd}] ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
97 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
98 _hg_cmd_${cmd}
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
99 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
100 # complete unknown commands normally
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
101 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
102 '*:files:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
103 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
104 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
105
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
106 _hg_cache_policy() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
107 typeset -a old
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
108
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
109 # cache for a minute
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
110 old=( "$1"(mm+10) )
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
111 (( $#old )) && return 0
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
112
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
113 return 1
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
114 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
115
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
116 _hg_get_commands() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
117 typeset -ga _hg_cmd_list
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
118 typeset -gA _hg_alias_list
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
119 local hline cmd cmdalias
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
120
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
121 _call_program hg hg debugcomplete -v 2>/dev/null | while read -A hline
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
122 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
123 cmd=$hline[1]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
124 _hg_cmd_list+=($cmd)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
125
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
126 for cmdalias in $hline[2,-1]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
127 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
128 _hg_cmd_list+=($cmdalias)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
129 _hg_alias_list+=($cmdalias $cmd)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
130 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
131 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
132 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
133
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
134 _hg_commands() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
135 (( $#_hg_cmd_list )) || _hg_get_commands
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
136 _describe -t commands 'mercurial command' _hg_cmd_list
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
137 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
138
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
139 _hg_revrange() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
140 compset -P 1 '*:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
141 _hg_tags "$@"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
142 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
143
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
144 _hg_tags() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
145 typeset -a tags
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
146 local tag rev
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
147
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
148 _hg_cmd tags 2> /dev/null | while read tag
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
149 do
56
1c75cab141ae Fix up the number of spaces required so really long branch names don't screw up the completion.
Augie Fackler <durin42@gmail.com>
parents: 55
diff changeset
150 tags+=(${tag/ # [0-9]#:*})
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
151 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
152 (( $#tags )) && _describe -t tags 'tags' tags
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
153 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
154
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
155 _hg_branches() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
156 typeset -a branches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
157 local branch
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
158
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
159 _hg_cmd branches -a 2> /dev/null | while read branch
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
160 do
56
1c75cab141ae Fix up the number of spaces required so really long branch names don't screw up the completion.
Augie Fackler <durin42@gmail.com>
parents: 55
diff changeset
161 branches+=(${branch/ # [0-9]#:*})
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
162 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
163 (( $#branches )) && _describe -t branches 'branches' branches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
164 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
165
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
166 _hg_branchtags() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
167 typeset -a branchtags
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
168 local branch tag
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
169
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
170 _hg_cmd tags 2> /dev/null | while read tag
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
171 do
56
1c75cab141ae Fix up the number of spaces required so really long branch names don't screw up the completion.
Augie Fackler <durin42@gmail.com>
parents: 55
diff changeset
172 branchtags+=(${tag/ # [0-9]#:*})
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
173 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
174
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
175 _hg_cmd branches -a 2> /dev/null | while read branch
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
176 do
56
1c75cab141ae Fix up the number of spaces required so really long branch names don't screw up the completion.
Augie Fackler <durin42@gmail.com>
parents: 55
diff changeset
177 branchtags+=(${branch/ # [0-9]#:*})
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
178 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
179 (( $#branchtags )) && _describe -t branchtags 'branchtags' branchtags
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
180 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
181
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
182 _hg_files() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
183 if [[ -n "$_hg_root" ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
184 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
185 [[ -d "$_hg_root/.hg" ]] || return
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
186 case "$_hg_root" in
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
187 /*)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
188 _files -W $_hg_root
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
189 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
190 *)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
191 _files -W $PWD/$_hg_root
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
192 ;;
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
193 esac
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
194 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
195 _files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
196 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
197 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
198
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
199 _hg_status() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
200 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
201 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
202 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
203
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
204 _hg_unknown() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
205 typeset -a status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
206 _hg_status u
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
207 _wanted files expl 'unknown files' _multi_parts / status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
208 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
209
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
210 _hg_missing() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
211 typeset -a status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
212 _hg_status d
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
213 _wanted files expl 'missing files' _multi_parts / status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
214 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
215
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
216 _hg_modified() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
217 typeset -a status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
218 _hg_status m
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
219 _wanted files expl 'modified files' _multi_parts / status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
220 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
221
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
222 _hg_resolve() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
223 local rstate rpah
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
224
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
225 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
226
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
227 _hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
228 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
229 [[ $rstate == 'R' ]] && resolved_files+=($rpath)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
230 [[ $rstate == 'U' ]] && unresolved_files+=($rpath)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
231 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
232 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
233
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
234 _hg_resolved() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
235 typeset -a resolved_files unresolved_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
236 _hg_resolve
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
237 _wanted files expl 'resolved files' _multi_parts / resolved_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
238 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
239
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
240 _hg_unresolved() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
241 typeset -a resolved_files unresolved_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
242 _hg_resolve
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
243 _wanted files expl 'unresolved files' _multi_parts / unresolved_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
244 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
245
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
246 _hg_config() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
247 typeset -a items
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
248 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
249 (( $#items )) && _describe -t config 'config item' items
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
250 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
251
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
252 _hg_addremove() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
253 _alternative 'files:unknown files:_hg_unknown' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
254 'files:missing files:_hg_missing'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
255 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
256
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
257 _hg_ssh_urls() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
258 if [[ -prefix */ ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
259 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
260 if zstyle -T ":completion:${curcontext}:files" remote-access
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
261 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
262 local host=${PREFIX%%/*}
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
263 typeset -a remdirs
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
264 compset -p $(( $#host + 1 ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
265 local rempath=${(M)PREFIX##*/}
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
266 local cacheid="hg:${host}-${rempath//\//_}"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
267 cacheid=${cacheid%[-_]}
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
268 compset -P '*/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
269 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
270 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
271 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" 2> /dev/null)"}##*/}%/})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
272 _store_cache "$cacheid" remdirs
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
273 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
274 _describe -t directories 'remote directory' remdirs -S/
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
275 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
276 _message 'remote directory'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
277 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
278 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
279 if compset -P '*@'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
280 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
281 _hosts -S/
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
282 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
283 _alternative 'hosts:remote host name:_hosts -S/' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
284 'users:user:_users -S@'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
285 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
286 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
287 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
288
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
289 _hg_urls() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
290 if compset -P bundle://
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
291 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
292 _files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
293 elif compset -P ssh://
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
294 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
295 _hg_ssh_urls
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
296 elif [[ -prefix *: ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
297 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
298 _urls
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
299 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
300 local expl
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
301 compset -S '[^:]*'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
302 _wanted url-schemas expl 'URL schema' compadd -S '' - \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
303 http:// https:// ssh:// bundle://
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
304 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
305 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
306
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
307 _hg_paths() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
308 typeset -a paths pnames
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
309 _hg_cmd paths 2> /dev/null | while read -A pnames
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
310 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
311 paths+=($pnames[1])
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
312 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
313 (( $#paths )) && _describe -t path-aliases 'repository alias' paths
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
314 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
315
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
316 _hg_remote() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
317 _alternative 'path-aliases:repository alias:_hg_paths' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
318 'directories:directory:_files -/' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
319 'urls:URL:_hg_urls'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
320 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
321
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
322 _hg_clone_dest() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
323 _alternative 'directories:directory:_files -/' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
324 'urls:URL:_hg_urls'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
325 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
326
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
327 # Common options
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
328 _hg_global_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
329 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
330 '--cwd[change working directory]:new working directory:_files -/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
331 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
332 '(--verbose -v)'{-v,--verbose}'[enable additional output]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
333 '*--config[set/override config option]:defined config items:_hg_config'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
334 '(--quiet -q)'{-q,--quiet}'[suppress output]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
335 '(--help -h)'{-h,--help}'[display help and exit]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
336 '--debug[debug mode]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
337 '--debugger[start debugger]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
338 '--encoding[set the charset encoding (default: UTF8)]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
339 '--encodingmode[set the charset encoding mode (default: strict)]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
340 '--lsprof[print improved command execution profile]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
341 '--traceback[print traceback on exception]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
342 '--time[time how long the command takes]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
343 '--profile[profile]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
344 '--version[output version information and exit]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
345 )
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
346
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
347 _hg_pat_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
348 '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
349 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
350
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
351 _hg_diff_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
352 '(--text -a)'{-a,--text}'[treat all files as text]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
353 '(--git -g)'{-g,--git}'[use git extended diff format]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
354 "--nodates[don't include dates in diff headers]")
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
355
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
356 _hg_dryrun_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
357 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
358
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
359 _hg_style_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
360 '--style[display using template map file]:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
361 '--template[display with template]:')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
362
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
363 _hg_commit_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
364 '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
365 '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
366 '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
367
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
368 _hg_remote_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
369 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
370 '--remotecmd[specify hg command to run on the remote side]:')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
371
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
372 _hg_cmd() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
373 _call_program hg hg "$_hg_cmd_globals[@]" "$@"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
374 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
375
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
376 _hg_cmd_add() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
377 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
378 '*:unknown files:_hg_unknown'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
379 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
380
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
381 _hg_cmd_addremove() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
382 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
383 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
384 '*:unknown or missing files:_hg_addremove'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
385 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
386
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
387 _hg_cmd_annotate() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
388 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
389 '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
390 '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
391 '(--text -a)'{-a,--text}'[treat all files as text]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
392 '(--user -u)'{-u,--user}'[list the author]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
393 '(--date -d)'{-d,--date}'[list the date]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
394 '(--number -n)'{-n,--number}'[list the revision number (default)]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
395 '(--changeset -c)'{-c,--changeset}'[list the changeset]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
396 '*:files:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
397 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
398
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
399 _hg_cmd_archive() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
400 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
401 '--no-decode[do not pass files through decoders]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
402 '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
403 '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
404 '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
405 '*:destination:_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
406 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
407
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
408 _hg_cmd_backout() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
409 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
410 '--merge[merge with old dirstate parent after backout]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
411 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
412 '--parent[parent to choose when backing out merge]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
413 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
414 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
415 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
416 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
417 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
418
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
419 _hg_cmd_bundle() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
420 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
421 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
422 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
423 ':output file:_files' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
424 ':destination repository:_files -/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
425 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
426
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
427 _hg_cmd_cat() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
428 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
429 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
430 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
431 '*:file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
432 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
433
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
434 _hg_cmd_clone() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
435 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
436 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
437 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
438 '--uncompressed[use uncompressed transfer (fast over LAN)]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
439 ':source repository:_hg_remote' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
440 ':destination:_hg_clone_dest'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
441 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
442
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
443 _hg_cmd_commit() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
444 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
445 '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
446 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
447 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
448 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
449 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
450 '*:file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
451 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
452
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
453 _hg_cmd_copy() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
454 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
455 '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
456 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
457 '*:file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
458 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
459
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
460 _hg_cmd_diff() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
461 typeset -A opt_args
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
462 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
463 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
464 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
465 '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
466 '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
467 '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
468 '*:file:->diff_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
469
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
470 if [[ $state == 'diff_files' ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
471 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
472 if [[ -n $opt_args[-r] ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
473 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
474 _hg_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
475 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
476 _hg_modified
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
477 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
478 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
479 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
480
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
481 _hg_cmd_export() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
482 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
483 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
484 '--switch-parent[diff against the second parent]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
485 '*:revision:_hg_tags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
486 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
487
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
488 _hg_cmd_grep() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
489 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
490 '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
491 '--all[print all revisions with matches]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
492 '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
493 '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
494 '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
495 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
496 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
497 '(--user -u)'{-u,--user}'[print user who committed change]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
498 '1:search pattern:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
499 '*:files:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
500 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
501
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
502 _hg_cmd_heads() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
503 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
504 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
505 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
506
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
507 _hg_cmd_help() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
508 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
509 '*:mercurial command:_hg_commands'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
510 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
511
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
512 _hg_cmd_identify() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
513 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
514 '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
515 '(--num -n)'{-n+,--num}'[show local revision number]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
516 '(--id -i)'{-i+,--id}'[show global revision id]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
517 '(--branch -b)'{-b+,--branch}'[show branch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
518 '(--tags -t)'{-t+,--tags}'[show tags]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
519 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
520
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
521 _hg_cmd_import() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
522 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
523 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
524 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
525 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
526 '*:patch:_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
527 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
528
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
529 _hg_cmd_incoming() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
530 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
531 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
532 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
533 '(--patch -p)'{-p,--patch}'[show patch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
534 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
535 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
536 '--bundle[file to store the bundles into]:bundle file:_files' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
537 ':source:_hg_remote'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
538 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
539
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
540 _hg_cmd_init() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
541 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
542 ':dir:_files -/'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
543 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
544
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
545 _hg_cmd_locate() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
546 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
547 '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
548 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
549 '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
550 '*:search pattern:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
551 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
552
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
553 _hg_cmd_log() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
554 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
555 '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
556 '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
557 '(--copies -C)'{-C,--copies}'[show copied files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
558 '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
559 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
560 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
561 '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
562 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
563 '(--patch -p)'{-p,--patch}'[show patch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
564 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
565 '*:files:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
566 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
567
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
568 _hg_cmd_manifest() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
569 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
570 ':revision:_hg_tags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
571 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
572
57
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
573 _hg_cmd_merge() {
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
574 _arguments -s -w : $_hg_global_opts \
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
575 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
576 '(--rev -r)'{-r,--rev}'[revision to merge]:revision:_hg_branches' \
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
577 ':revision:_hg_branches'
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
578 }
0ba810271408 basic completions for hg merge
Augie Fackler <durin42@gmail.com>
parents: 56
diff changeset
579
55
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
580 _hg_cmd_outgoing() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
581 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
582 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
583 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
584 '(--patch -p)'{-p,--patch}'[show patch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
585 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
586 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
587 ':destination:_hg_remote'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
588 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
589
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
590 _hg_cmd_parents() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
591 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
592 '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
593 ':last modified file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
594 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
595
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
596 _hg_cmd_paths() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
597 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
598 ':path:_hg_paths'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
599 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
600
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
601 _hg_cmd_pull() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
602 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
603 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
604 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
605 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
606 ':source:_hg_remote'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
607 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
608
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
609 _hg_cmd_push() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
610 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
611 '(--force -f)'{-f,--force}'[force push]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
612 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
613 ':destination:_hg_remote'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
614 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
615
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
616 _hg_cmd_remove() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
617 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
618 '(--after -A)'{-A,--after}'[record remove that has already occurred]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
619 '(--force -f)'{-f,--force}'[remove file even if modified]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
620 '*:file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
621 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
622
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
623 _hg_cmd_rename() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
624 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
625 '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
626 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
627 '*:file:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
628 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
629
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
630 _hg_cmd_resolve() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
631 local context state line
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
632 typeset -A opt_args
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
633
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
634 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
635 '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
636 '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
637 '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
638 '*:file:_hg_unresolved'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
639
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
640 if [[ $state == 'resolve_files' ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
641 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
642 _alternative 'files:resolved files:_hg_resolved' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
643 'files:unresolved files:_hg_unresolved'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
644 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
645 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
646
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
647 _hg_cmd_revert() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
648 local context state line
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
649 typeset -A opt_args
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
650
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
651 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
652 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
653 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
654 '--no-backup[do not save backup copies of files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
655 '*:file:->diff_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
656
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
657 if [[ $state == 'diff_files' ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
658 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
659 if [[ -n $opt_args[-r] ]]
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
660 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
661 _hg_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
662 else
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
663 typeset -a status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
664 _hg_status mard
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
665 _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
666 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
667 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
668 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
669
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
670 _hg_cmd_serve() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
671 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
672 '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
673 '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
674 '(--daemon -d)'{-d,--daemon}'[run server in background]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
675 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
676 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
677 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
678 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
679 '--style[web template style]:style' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
680 '--stdio[for remote clients]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
681 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
682 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
683
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
684 _hg_cmd_showconfig() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
685 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
686 '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
687 ':config item:_hg_config'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
688 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
689
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
690 _hg_cmd_status() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
691 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
692 '(--all -A)'{-A,--all}'[show status of all files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
693 '(--modified -m)'{-m,--modified}'[show only modified files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
694 '(--added -a)'{-a,--added}'[show only added files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
695 '(--removed -r)'{-r,--removed}'[show only removed files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
696 '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
697 '(--clean -c)'{-c,--clean}'[show only files without changes]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
698 '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
699 '(--ignored -i)'{-i,--ignored}'[show ignored files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
700 '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
701 '(--copies -C)'{-C,--copies}'[show source of copied files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
702 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
703 '--rev[show difference from revision]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
704 '*:files:_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
705 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
706
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
707 _hg_cmd_tag() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
708 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
709 '(--local -l)'{-l,--local}'[make the tag local]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
710 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
711 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
712 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
713 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
714 ':tag name:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
715 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
716
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
717 _hg_cmd_tip() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
718 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
719 '(--patch -p)'{-p,--patch}'[show patch]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
720 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
721
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
722 _hg_cmd_unbundle() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
723 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
724 '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
725 ':files:_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
726 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
727
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
728 _hg_cmd_update() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
729 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
730 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
731 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_branchtags' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
732 ':revision:_hg_branchtags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
733 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
734
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
735 # bisect extension
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
736 _hg_cmd_bisect() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
737 _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
738 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
739
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
740 # HGK
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
741 _hg_cmd_view() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
742 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
743 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
744 ':revision range:_hg_tags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
745 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
746
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
747 # MQ
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
748 _hg_qseries() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
749 typeset -a patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
750 patches=(${(f)"$(_hg_cmd qseries 2>/dev/null)"})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
751 (( $#patches )) && _describe -t hg-patches 'patches' patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
752 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
753
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
754 _hg_qapplied() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
755 typeset -a patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
756 patches=(${(f)"$(_hg_cmd qapplied 2>/dev/null)"})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
757 if (( $#patches ))
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
758 then
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
759 patches+=(qbase qtip)
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
760 _describe -t hg-applied-patches 'applied patches' patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
761 fi
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
762 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
763
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
764 _hg_qunapplied() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
765 typeset -a patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
766 patches=(${(f)"$(_hg_cmd qunapplied 2>/dev/null)"})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
767 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
768 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
769
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
770 _hg_qguards() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
771 typeset -a guards
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
772 local guard
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
773 compset -P "+|-"
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
774 _hg_cmd qselect -s 2>/dev/null | while read guard
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
775 do
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
776 guards+=(${guard#(+|-)})
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
777 done
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
778 (( $#guards )) && _describe -t hg-guards 'guards' guards
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
779 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
780
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
781 _hg_qseries_opts=(
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
782 '(--summary -s)'{-s,--summary}'[print first line of patch header]')
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
783
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
784 _hg_cmd_qapplied() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
785 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
786 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
787
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
788 _hg_cmd_qdelete() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
789 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
790 '(--keep -k)'{-k,--keep}'[keep patch file]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
791 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
792 '*:unapplied patch:_hg_qunapplied'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
793 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
794
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
795 _hg_cmd_qdiff() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
796 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
797 '*:pattern:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
798 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
799
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
800 _hg_cmd_qfold() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
801 _arguments -s -w : $_hg_global_opts $_h_commit_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
802 '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
803 '*:unapplied patch:_hg_qunapplied'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
804 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
805
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
806 _hg_cmd_qgoto() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
807 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
808 '(--force -f)'{-f,--force}'[overwrite any local changes]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
809 ':patch:_hg_qseries'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
810 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
811
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
812 _hg_cmd_qguard() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
813 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
814 '(--list -l)'{-l,--list}'[list all patches and guards]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
815 '(--none -n)'{-n,--none}'[drop all guards]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
816 ':patch:_hg_qseries' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
817 '*:guards:_hg_qguards'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
818 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
819
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
820 _hg_cmd_qheader() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
821 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
822 ':patch:_hg_qseries'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
823 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
824
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
825 _hg_cmd_qimport() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
826 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
827 '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
828 '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
829 '(--force -f)'{-f,--force}'[overwrite existing files]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
830 '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
831 '*:patch:_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
832 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
833
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
834 _hg_cmd_qnew() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
835 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
836 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
837 ':patch:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
838 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
839
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
840 _hg_cmd_qnext() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
841 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
842 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
843
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
844 _hg_cmd_qpop() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
845 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
846 '(--all -a :)'{-a,--all}'[pop all patches]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
847 '(--name -n)'{-n+,--name}'[queue name to pop]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
848 '(--force -f)'{-f,--force}'[forget any local changes]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
849 ':patch:_hg_qapplied'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
850 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
851
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
852 _hg_cmd_qprev() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
853 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
854 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
855
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
856 _hg_cmd_qpush() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
857 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
858 '(--all -a :)'{-a,--all}'[apply all patches]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
859 '(--list -l)'{-l,--list}'[list patch name in commit text]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
860 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
861 '(--name -n)'{-n+,--name}'[merge queue name]:' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
862 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
863 ':patch:_hg_qunapplied'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
864 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
865
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
866 _hg_cmd_qrefresh() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
867 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
868 '(--git -g)'{-g,--git}'[use git extended diff format]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
869 '(--short -s)'{-s,--short}'[short refresh]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
870 '*:files:_hg_files'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
871 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
872
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
873 _hg_cmd_qrename() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
874 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
875 ':patch:_hg_qseries' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
876 ':destination:'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
877 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
878
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
879 _hg_cmd_qselect() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
880 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
881 '(--none -n :)'{-n,--none}'[disable all guards]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
882 '(--series -s :)'{-s,--series}'[list all guards in series file]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
883 '--pop[pop to before first guarded applied patch]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
884 '--reapply[pop and reapply patches]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
885 '*:guards:_hg_qguards'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
886 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
887
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
888 _hg_cmd_qseries() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
889 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
890 '(--missing -m)'{-m,--missing}'[print patches not in series]'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
891 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
892
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
893 _hg_cmd_qunapplied() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
894 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
895 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
896
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
897 _hg_cmd_qtop() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
898 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
899 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
900
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
901 _hg_cmd_strip() {
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
902 _arguments -s -w : $_hg_global_opts \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
903 '(--force -f)'{-f,--force}'[force multi-head removal]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
904 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
905 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
906 ':revision:_hg_tags'
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
907 }
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
908
846d556d9619 Add a custom _hg (modified off of recent crew) and fix up function path stuff in hg to improve my hg tab completions.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
909 _hg "$@"