contrib/zsh_completion
changeset 39462 2815e0db4c54
parent 39421 09f23b4f1be3
child 39463 45d12c49c3f3
equal deleted inserted replaced
39461:9a813e4c8406 39462:2815e0db4c54
   191   (( $#branches )) && _describe -t branches 'branches' branches
   191   (( $#branches )) && _describe -t branches 'branches' branches
   192 }
   192 }
   193 
   193 
   194 # likely merge candidates
   194 # likely merge candidates
   195 _hg_mergerevs() {
   195 _hg_mergerevs() {
   196   typeset -a heads
   196   typeset -a heads branches
   197   local myrev
   197   local revset='sort(head() and not ., -rev)'
   198 
   198 
   199   heads=(${(f)"$(_hg_cmd heads --template '{rev}:{branch}\\n')"})
   199   heads=(${(f)"$(_hg_cmd log -r '$revset' --template '{rev}:{branch}\\n')"})
   200   # exclude own revision
       
   201   myrev=$(_hg_cmd log -r . --template '{rev}:{branch}\\n')
       
   202   heads=(${heads:#$myrev})
       
   203 
       
   204   (( $#heads )) && _describe -t heads 'heads' heads
   200   (( $#heads )) && _describe -t heads 'heads' heads
   205 
   201 
   206   branches=(${(f)"$(_hg_cmd heads --template '{branch}\\n')"})
   202   branches=(${(S)heads/#*:/})
   207   # exclude own revision
       
   208   myrev=$(_hg_cmd log -r . --template '{branch}\\n')
       
   209   branches=(${branches:#$myrev})
       
   210 
       
   211   (( $#branches )) && _describe -t branches 'branches' branches
   203   (( $#branches )) && _describe -t branches 'branches' branches
   212 }
   204 }
   213 
   205 
   214 _hg_files() {
   206 _hg_files() {
   215   if [[ -n "$_hg_root" ]]
   207   if [[ -n "$_hg_root" ]]