1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-20 06:56:05 +02:00

43347: _hg: use revsets for suggestions for hg merge

This commit is contained in:
Anton Shestakov 2018-08-29 08:17:30 +08:00 committed by Oliver Kiddle
parent 419625bf87
commit 06f3bc09c0
2 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2018-08-29 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43347: Anton Shestakov: Completion/Unix/Command/_hg:
use revsets for suggestions for hg merge
2018-08-28 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43345: Completion/Unix/Command/_mount,

View File

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