Useful to have and is consistent with our bash completion file.
This is also an improvement coming from upstream, downstream or sidestream
(depends on how you look at it) hg completion file -- the one that lives in
zsh's own repo.
spectral |
hg-reviewers |
Useful to have and is consistent with our bash completion file.
This is also an improvement coming from upstream, downstream or sidestream
(depends on how you look at it) hg completion file -- the one that lives in
zsh's own repo.
Lint Skipped |
Unit Tests Skipped |
} | } | ||||
_hg_missing() { | _hg_missing() { | ||||
typeset -a status_files | typeset -a status_files | ||||
_hg_status d | _hg_status d | ||||
_wanted files expl 'missing files' _multi_parts / status_files | _wanted files expl 'missing files' _multi_parts / status_files | ||||
} | } | ||||
_hg_modified() { | _hg_committable() { | ||||
typeset -a status_files | typeset -a status_files | ||||
_hg_status m | _hg_status mar | ||||
_wanted files expl 'modified files' _multi_parts / status_files | _wanted files expl 'modified, added or removed files' _multi_parts / status_files | ||||
} | } | ||||
_hg_resolve() { | _hg_resolve() { | ||||
local rstate rpath | local rstate rpath | ||||
[[ -d $PREFIX ]] || PREFIX=$PREFIX:h | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | ||||
_hg_cmd resolve -l ./$PREFIX | while read rstate rpath | _hg_cmd resolve -l ./$PREFIX | while read rstate rpath | ||||
_arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ | _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ | ||||
'(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ | '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ | ||||
'(--message -m)'{-m+,--message=}'[use <text> as commit message]:text:' \ | '(--message -m)'{-m+,--message=}'[use <text> as commit message]:text:' \ | ||||
'(--logfile -l)'{-l+,--logfile=}'[read commit message from <file>]:log file:_files' \ | '(--logfile -l)'{-l+,--logfile=}'[read commit message from <file>]:log file:_files' \ | ||||
'(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \ | '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \ | ||||
'(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \ | '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \ | ||||
'--amend[amend the parent of the working dir]' \ | '--amend[amend the parent of the working dir]' \ | ||||
'--close-branch[mark a branch as closed]' \ | '--close-branch[mark a branch as closed]' \ | ||||
'*:file:_hg_files' | '*:file:_hg_committable' | ||||
} | } | ||||
_hg_cmd_copy() { | _hg_cmd_copy() { | ||||
_arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | _arguments -s -S : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | ||||
'(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ | '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ | ||||
'(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ | '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ | ||||
'*:file:_hg_files' | '*:file:_hg_files' | ||||
} | } | ||||
'*:file:->diff_files' | '*:file:->diff_files' | ||||
if [[ $state == 'diff_files' ]] | if [[ $state == 'diff_files' ]] | ||||
then | then | ||||
if [[ -n $opt_args[-r] ]] | if [[ -n $opt_args[-r] ]] | ||||
then | then | ||||
_hg_files | _hg_files | ||||
else | else | ||||
_hg_modified | _hg_committable | ||||
fi | fi | ||||
fi | fi | ||||
} | } | ||||
_hg_cmd_export() { | _hg_cmd_export() { | ||||
_arguments -s -S : $_hg_global_opts $_hg_diff_opts \ | _arguments -s -S : $_hg_global_opts $_hg_diff_opts \ | ||||
'(--outout -o)'{-o+,--output=}'[print output to file with formatted name]:filespec:' \ | '(--outout -o)'{-o+,--output=}'[print output to file with formatted name]:filespec:' \ | ||||
'--switch-parent[diff against the second parent]' \ | '--switch-parent[diff against the second parent]' \ |