D4427: zsh_completion: handle --rev as well as -r for diff and revert

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Fri Aug 31 05:42:50 UTC 2018


av6 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4427

AFFECTED FILES
  contrib/zsh_completion

CHANGE DETAILS

diff --git a/contrib/zsh_completion b/contrib/zsh_completion
--- a/contrib/zsh_completion
+++ b/contrib/zsh_completion
@@ -616,7 +616,7 @@
 
   if [[ $state == 'diff_files' ]]
   then
-    if [[ -n $opt_args[-r] ]]
+    if [[ -n ${opt_args[(I)-r|--rev]} ]]
     then
       _hg_files && ret=0
     else
@@ -862,7 +862,7 @@
 
   if [[ $state == 'revert_files' ]]
   then
-    if [[ -n $opt_args[-r] ]]
+    if [[ -n ${opt_args[(I)-r|--rev]} ]]
     then
       _hg_files && ret=0
     else



To: av6, #hg-reviewers
Cc: mercurial-devel, spectral


More information about the Mercurial-devel mailing list