--- a/.bash_prompt Wed Nov 12 21:39:50 2014 +0800
+++ b/.bash_prompt Sat Nov 29 13:38:16 2014 +0800
- # testing if current dir is a part of hg/git repo
- [[ -d "$TEST_DIR/.hg" ]] && local HG_TRACKED=1 && break
- [[ -d "$TEST_DIR/.git" ]] && local GIT_TRACKED=1 && break
- [[ "$TEST_DIR" == '/' ]] && break
- TEST_DIR=$(dirname "$TEST_DIR")
- if [[ $HG_TRACKED ]] ; then
- if [[ $GIT_TRACKED ]] ; then
if [[ $VIRTUAL_ENV ]] ; then
${PROMPT_COLOR}\\\$${RESET} "
+ test "$PWD" == '/' && return || test -e '.hg' && echo 'hg' && return || test -e '.git' && echo 'git' && return || cd .. && _upsearch
if [[ $USE_HG_PROMPT ]] ; then
local PROMPT_TEMPLATE="${P}{branch|quiet}{${Rd}{closed}}${P}☿{rev}{${B}+{tags|quiet|+}}{${Gd}*{bookmark}}{${R}{update}}{${G}+{rev|merge}}${R}{status|modified}${RESET}"