diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index e39663a9..110bd43f 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -502,7 +502,9 @@ function vcs_commit_git() { } # Subversion function vcs_commit_svn() { - svn commit -m "$@" + # svn commit -m "$@" + # subversion commits hit the upstream server; best to not commit + : } # Perforce function vcs_commit_p4() { diff --git a/bin/blackbox_deregister_file b/bin/blackbox_deregister_file index 04f4ecb0..e2591e8d 100755 --- a/bin/blackbox_deregister_file +++ b/bin/blackbox_deregister_file @@ -29,7 +29,14 @@ vcs_remove "$encrypted_file" vcs_notice "$unencrypted_file" vcs_add "$BB_FILES" -vcs_commit "Removing from blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file" -echo "========== UPDATING VCS: DONE" -echo "Local repo updated. Please push when ready." -echo " $VCS_TYPE push" +if [[ $VCS_TYPE == "svn" ]]; then + echo "========== UPDATING VCS: DONE" + echo "Local repo updated." + echo "Please commit to subversion server when ready." + echo " svn commit" +else: + vcs_commit "Removing from blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file" + echo "========== UPDATING VCS: DONE" + echo "Local repo updated. Please push when ready." + echo " $VCS_TYPE push" +fi diff --git a/bin/blackbox_initialize b/bin/blackbox_initialize index 96786b56..7c7cc66e 100755 --- a/bin/blackbox_initialize +++ b/bin/blackbox_initialize @@ -35,17 +35,18 @@ vcs_add "${KEYRINGDIR}" touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" vcs_add "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" -if [[ $VCS_TYPE = "svn" ]]; then - echo - echo +# Make a suggestion: +# some whitespace +echo +echo +if [[ $VCS_TYPE == "svn" ]]; then echo '`subversion` automatically tracks the ignored files; you just need to commit.' + echo 'NEXT STEP: You need to manually check these in:' + echo ' ' svn commit -m\'INITIALIZE BLACKBOX\' keyrings 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" fi diff --git a/bin/blackbox_register_new_file b/bin/blackbox_register_new_file index 08befcc9..6b1ce48b 100755 --- a/bin/blackbox_register_new_file +++ b/bin/blackbox_register_new_file @@ -44,7 +44,11 @@ function register_new_file() { vcs_ignore "$unencrypted_file" echo 'NOTE: "already tracked!" messages are safe to ignore.' vcs_add "$BB_FILES" "$encrypted_file" - vcs_commit "registered in blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file" + if [[ $VCS_TYPE == "svn" ]]; then + echo "registered in blackbox: ${unencrypted_file} as ${encrypted_file}; you must commit to subversion repo." + else + vcs_commit "registered in blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file" + fi } for target in "$@"; do @@ -52,9 +56,9 @@ for target in "$@"; do done echo "========== UPDATING VCS: DONE" -if [[ $VCS_TYPE = "svn" ]]; then - echo "Local repo updated and file pushed to source control (unless an error was displayed)." +echo "Local repo updated. Please push when ready." +if [[ $VCS_TYPE == "svn" ]]; then + echo " svn commit" else - echo "Local repo updated. Please push when ready." echo " $VCS_TYPE push" fi diff --git a/bin/blackbox_update_all_files b/bin/blackbox_update_all_files index 564f002d..afbb8dad 100755 --- a/bin/blackbox_update_all_files +++ b/bin/blackbox_update_all_files @@ -53,12 +53,20 @@ done 99<"$BB_FILES" fail_if_keychain_has_secrets -echo '========== COMMITING TO VCS:' +echo '========== ADDING TO VCS:' while IFS= read <&99 -r unencrypted_file; do vcs_add "$unencrypted_file.gpg" done 99<"$BB_FILES" -vcs_commit 'Re-encrypted keys' + +if [[ $VCS_TYPE != "svn" ]]; then + echo '========== COMITTING TO VCS:' + vcs_commit 'Re-encrypted keys' +fi echo '========== DONE.' echo 'Likely next step:' -echo " $VCS_TYPE push" +if [[ $VCS_TYPE == "svn" ]]; then + echo " svn commit" +else + echo " $VCS_TYPE push" +fi