zsh_completion: complete files from `hg st -mar` for commit and diff
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 10 Aug 2018 08:59:52 +0800
changeset 39204 8ff14f8fe2d3
parent 39203 fd17590655cf
child 39205 69876534caf2
zsh_completion: complete files from `hg st -mar` for commit and diff 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. Differential Revision: https://phab.mercurial-scm.org/D4263
contrib/zsh_completion
--- a/contrib/zsh_completion	Fri Aug 10 08:33:27 2018 +0800
+++ b/contrib/zsh_completion	Fri Aug 10 08:59:52 2018 +0800
@@ -245,10 +245,10 @@
   _wanted files expl 'missing files' _multi_parts / status_files
 }
 
-_hg_modified() {
+_hg_committable() {
   typeset -a status_files
-  _hg_status m
-  _wanted files expl 'modified files' _multi_parts / status_files
+  _hg_status mar
+  _wanted files expl 'modified, added or removed files' _multi_parts / status_files
 }
 
 _hg_resolve() {
@@ -570,7 +570,7 @@
   '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \
   '--amend[amend the parent of the working dir]' \
   '--close-branch[mark a branch as closed]' \
-  '*:file:_hg_files'
+  '*:file:_hg_committable'
 }
 
 _hg_cmd_copy() {
@@ -599,7 +599,7 @@
     then
       _hg_files
     else
-      _hg_modified
+      _hg_committable
     fi
   fi
 }