From 26118d18356002e96cbb7debd84948fb229ce6da Mon Sep 17 00:00:00 2001 From: Oliver Ruben Albertini Date: Wed, 21 Apr 2021 18:06:24 -0700 Subject: [PATCH] [base.theme] add support for hg's bookmarks feature Will conditionally show the branch based on the current bookmark instead of branch. --- themes/base.theme.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index e84cc291..a1520397 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -359,7 +359,9 @@ function hg_prompt_vars { if [ -f "$HG_ROOT/branch" ]; then # 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 SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}') fi