summaryrefslogtreecommitdiff
path: root/01_Functions.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2011-01-04 15:00:05 +0100
committerHugues Hiegel <hugues@hiegel.fr>2011-01-04 16:18:30 +0100
commitd8d91c2ea86abd7b3343cd3853b95181155e81ac (patch)
tree9dcfcb7b7841bf57816aef8ce5ae9600b343defb /01_Functions.zsh
parentbf9737efa36d16068cb1145d58c85c9e132e4f9c (diff)
[Prompts/Func] Get Mercurial branch
Diffstat (limited to '01_Functions.zsh')
-rw-r--r--01_Functions.zsh26
1 files changed, 22 insertions, 4 deletions
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