diff --git a/bash/bash_vcs.sh b/bash/bash_vcs.sh index 1616a61..ec019a2 100644 --- a/bash/bash_vcs.sh +++ b/bash/bash_vcs.sh @@ -83,8 +83,20 @@ __prompt_command() { alias revert="svn revert" } + bzr_base_dir() { + # bzr root is really slow, so we simulate it + # with a bash script I modified frome here: + # http://unix.stackexchange.com/questions/6463/find-searching-in-parent-directories-instead-of-subdirectories + base_dir=$(pwd -P 2>/dev/null || command pwd) + while [ ! -e "$base_dir/.bzr" ]; do + # delete /* from the end of base_dir + base_dir=${base_dir%/*} + if [ "$base_dir" = "" ]; then return 1; fi + done + } + bzr_dir() { - base_dir=$(bzr root 2>/dev/null) || return 1 + bzr_base_dir || return 1 if [ -n "$base_dir" ]; then base_dir=`cd $base_dir; pwd` else @@ -139,4 +151,4 @@ if [ -z "$TM_SUPPORT_PATH"]; then trap 'echo -e "\e]1;$project>$BASH_COMMAND<\007\c"' DEBUG # show currently executing command in tab title ;; esac -fi \ No newline at end of file +fi