From d8d91c2ea86abd7b3343cd3853b95181155e81ac Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 4 Jan 2011 15:00:05 +0100 Subject: [Prompts/Func] Get Mercurial branch --- 01_Functions.zsh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 0e236e2..b189e87 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -112,14 +112,32 @@ preprint() fi } -get_git_branch () +get_gcl_branch () { - local my_git_branch checkouted_branch="yes" + case $1 in + git) + get_git_branch + ;; + hg) + get_hg_branch + ;; + *) + ;; + esac +} - if [ ! -z "$DO_NOT_CHECK_GIT_BRANCH" ] +get_hg_branch () +{ + HGROOT=$(hg root 2>/dev/null) + if [ ! -z "$HGROOT" ] then - return + hg branch fi +} + +get_git_branch () +{ + local my_git_branch checkouted_branch="yes" if [ -f ".repo/manifests.git/config" ] then -- cgit v1.2.3