__fish_hg_prompt: Only show current bookmark

This commit is contained in:
Fabian Homborg 2015-09-26 21:52:20 +02:00
parent a19f4dd4c8
commit 95908aa2bc

View file

@ -37,7 +37,9 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
return return
end end
set -l bookmark (hg bookmark -q) # With "-q", hg bookmark will always output every bookmark
# So our only option is to filter it ourselves
set -l bookmark (hg bookmark | string match ' \\**' | cut -d" " -f3)
# Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark # Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark
if test -n "$bookmark" if test -n "$bookmark"
set branch "$branch/$bookmark" set branch "$branch/$bookmark"