From 714f0e6099338d9d88fc20886ad445414cfce773 Mon Sep 17 00:00:00 2001 From: Christophe Aguettaz Date: Fri, 14 Mar 2014 16:01:20 +0100 Subject: [PATCH] Improved prompt speed when hg is not installed. Prevented bash from walking the path looking for hg when it is not installed during each prompt refresh. --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 629e81d..44c34ab 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -34,7 +34,7 @@ function scm { if [[ -f .git/HEAD ]]; then SCM=$SCM_GIT elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT elif [[ -d .hg ]]; then SCM=$SCM_HG - elif [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG + elif which hg &> /dev/null && [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG elif [[ -d .svn ]]; then SCM=$SCM_SVN else SCM=$SCM_NONE fi -- 2.17.1