diff options
Diffstat (limited to 'Completion/Unix/Command/_hg')
-rw-r--r-- | Completion/Unix/Command/_hg | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 4b88ce4ea..7b72605b3 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -192,13 +192,9 @@ _hg_tags() { # likely merge candidates _hg_mergerevs() { typeset -a heads - local myrev - - heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) - # exclude own revision - myrev=$(_hg_cmd log -r . --template '{rev}\\n') - heads=(${heads:#$myrev}) + local revset='sort(head() and not ., -rev)' + heads=(${(f)"$(_hg_cmd log -r '$revset' --template '{rev}\\n')"}) (( $#heads )) && _describe -t heads 'heads' heads } @@ -571,7 +567,7 @@ _hg_cmd_diff() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else @@ -799,7 +795,7 @@ _hg_cmd_revert() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else |