Skip to content

Commit

Permalink
Merge pull request #1874 from oliverralbertini/add-hg-bookmarks-support
Browse files Browse the repository at this point in the history
[base.theme] add support for hg's bookmarks feature
  • Loading branch information
Noah Gorny authored May 7, 2021
2 parents d3bb347 + 26118d1 commit 476c568
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/base.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 476c568

Please sign in to comment.