Merge pull request #1874 from oliverralbertini/add-hg-bookmarks-support

[base.theme] add support for hg's bookmarks feature
pull/1888/head
Noah Gorny 2021-05-08 00:13:20 +03:00 committed by GitHub
commit 476c568566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -359,7 +359,9 @@ function hg_prompt_vars {
if [ -f "$HG_ROOT/branch" ]; then if [ -f "$HG_ROOT/branch" ]; then
# Mercurial holds it's current branch in .hg/branch file # Mercurial holds it's current branch in .hg/branch file
SCM_BRANCH=$(cat "$HG_ROOT/branch") SCM_BRANCH=$(< "${HG_ROOT}/branch")
local bookmark=${HG_ROOT}/bookmarks.current
[[ -f ${bookmark} ]] && SCM_BRANCH+=:$(< "${bookmark}")
else else
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}') SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
fi fi