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
--- 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