From 47b9c1a4f283accb63cf8f5800bc93e45135e3a9 Mon Sep 17 00:00:00 2001 From: bendra Date: Sat, 18 Oct 2014 23:30:38 -0700 Subject: [PATCH] fix for svnroot --- bin/_blackbox_common.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index 216b227..8bc9457 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -19,7 +19,22 @@ function _determine_vcs_base_and_type() { if git rev-parse --show-toplevel 2>/dev/null ; then VCS_TYPE=git elif [ -d ".svn" ] ; then - echo `pwd` + #find topmost dir with .svn sub-dir + parent="" + grandparent="." + mydir=`pwd` + while [ -d "$grandparent/.svn" ]; do + parent=$grandparent + grandparent="$parent/.." + done + + if [ ! -z "$parent" ]; then + cd $parent + echo `pwd` + else + exit 1 + fi + cd $mydir VCS_TYPE=svn elif hg root 2>/dev/null ; then # NOTE: hg has to be tested last because it always "succeeds".