zsh_completion: handle --rev as well as -r for diff and revert
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 22 Aug 2018 09:12:22 +0800
changeset 39394 09f23b4f1be3
parent 39393 56469d475341
child 39395 a80b8832720d
zsh_completion: handle --rev as well as -r for diff and revert Completion for hg diff and revert should suggest all files in context of a non-current revision. The script used to look only for `-r foo`, and now it also understands `--rev foo`. Differential Revision: https://phab.mercurial-scm.org/D4427
contrib/zsh_completion
--- a/contrib/zsh_completion	Sun Aug 26 16:42:28 2018 -0400
+++ b/contrib/zsh_completion	Wed Aug 22 09:12:22 2018 +0800
@@ -624,7 +624,7 @@
 
   if [[ $state == 'diff_files' ]]
   then
-    if [[ -n $opt_args[-r] ]]
+    if [[ -n ${opt_args[(I)-r|--rev]} ]]
     then
       _hg_files && ret=0
     else
@@ -870,7 +870,7 @@
 
   if [[ $state == 'revert_files' ]]
   then
-    if [[ -n $opt_args[-r] ]]
+    if [[ -n ${opt_args[(I)-r|--rev]} ]]
     then
       _hg_files && ret=0
     else