[hg completions] remove a grep and use hg's native query syntax

This has the side benefit of working around a wild bug with readline+fish that I've reported to the upstream readline developers. (The result of that bug is that the hg processes are constantly being leaked as `bg` jobs in the shell, which is how I came to notice this in the first place)
This commit is contained in:
Alex Gaynor 2017-04-21 12:40:52 -04:00 committed by Fabian Homborg
parent 805a177673
commit f30c50cec5

View file

@ -318,7 +318,7 @@ function __fish_hg_sources
end end
function __fish_hg_mq_enabled function __fish_hg_mq_enabled
if set -l line (__fish_hg config | grep extensions.hgext.mq) if set -l line (__fish_hg config extensions.hgext.mq)
set -l parts (string split "=" -m 1 $line) set -l parts (string split "=" -m 1 $line)
not string match -r -q -- "^!" $parts[2] not string match -r -q -- "^!" $parts[2]
return return