Mercurial > dotfiles
changeset 298:901e85174513
rps1: show hg bookmark (if any) in rps1 instead of current branch
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 12 Nov 2012 16:29:06 -0600 |
parents | 6be920ed2fe4 |
children | 4a7d426f22cb |
files | .shell.d/50.vcs_functions.sh |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/.shell.d/50.vcs_functions.sh +++ b/.shell.d/50.vcs_functions.sh @@ -127,9 +127,14 @@ function vcs_current_branch() { fi hg branch 2> /dev/null > /dev/null if [ $? = 0 ] ; then + local bm=$(hg book | egrep ' \* ' | awk '{print $2}') local br=`hg branch | head -c 10` local rid=`hg parents --template '{node}\n' | head -n 1 | head -c 7` - echo "$br $rid" + if [ -z "$bm" ] ; then + echo "$br $rid" + else + echo "$bm $rid" + fi return 0 fi return 1