From f8c1653e09f277050e271474cab86954ece30604 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Fri, 22 Apr 2016 16:40:31 -0400 Subject: [PATCH] some updates for subversion --- bin/_blackbox_common.sh | 7 ++++++- bin/blackbox_initialize | 25 ++++++++++++++++++------- bin/blackbox_register_new_file | 8 ++++++-- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index 642e56a..e39663a 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -62,6 +62,11 @@ export REPOBASE=$(physical_directory_of "$REPOBASE") # FIXME: Verify this function by checking for .hg or .git # after determining what we believe to be the answer. +if [[ -n "$BLACKBOX_REPOBASE" ]]; then + echo "Using custom repobase: $BLACKBOX_REPOBASE" + export REPOBASE="$BLACKBOX_REPOBASE" +fi + KEYRINGDIR="$REPOBASE/$BLACKBOXDATA" BB_ADMINS_FILE="blackbox-admins.txt" BB_ADMINS="${KEYRINGDIR}/${BB_ADMINS_FILE}" @@ -567,7 +572,7 @@ function vcs_ignore_git() { } # Subversion function vcs_ignore_svn() { - svn propset svn:ignore "$(vcs_relative_path "$file")" + svn propset svn:ignore "$file" "$(vcs_relative_path)" } # Perforce function vcs_ignore_p4() { diff --git a/bin/blackbox_initialize b/bin/blackbox_initialize index aabad46..96786b5 100755 --- a/bin/blackbox_initialize +++ b/bin/blackbox_initialize @@ -19,6 +19,11 @@ if [[ $1 != 'yes' ]]; then fi fi +if [[ $VCS_TYPE = "unknown" ]]; then + echo 'Not in a known VCS directory' + exit 1 +fi + change_to_vcs_root echo VCS_TYPE: $VCS_TYPE @@ -30,11 +35,17 @@ vcs_add "${KEYRINGDIR}" touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" vcs_add "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" -IGNOREFILE="$(vcs_ignore_file_path)" -test -f "$IGNOREFILE" && vcs_add "$IGNOREFILE" +if [[ $VCS_TYPE = "svn" ]]; then + echo + echo + echo '`subversion` automatically tracks the ignored files; you just need to commit.' +else + IGNOREFILE="$(vcs_ignore_file_path)" + test -f "$IGNOREFILE" && vcs_add "$IGNOREFILE" -# Make a suggestion: -echo -echo -echo 'NEXT STEP: You need to manually check these in:' -echo ' ' $VCS_TYPE commit -m\'INITIALIZE BLACKBOX\' keyrings "$IGNOREFILE" + # Make a suggestion: + echo + echo + echo 'NEXT STEP: You need to manually check these in:' + echo ' ' $VCS_TYPE commit -m\'INITIALIZE BLACKBOX\' keyrings "$IGNOREFILE" +fi diff --git a/bin/blackbox_register_new_file b/bin/blackbox_register_new_file index 61fbf54..08befcc 100755 --- a/bin/blackbox_register_new_file +++ b/bin/blackbox_register_new_file @@ -52,5 +52,9 @@ for target in "$@"; do done echo "========== UPDATING VCS: DONE" -echo "Local repo updated. Please push when ready." -echo " $VCS_TYPE push" +if [[ $VCS_TYPE = "svn" ]]; then + echo "Local repo updated and file pushed to source control (unless an error was displayed)." +else + echo "Local repo updated. Please push when ready." + echo " $VCS_TYPE push" +fi