]> Pileus Git - ~andy/sunrise/commitdiff
scripts/sunrise-commit: Only test for changes in cwd after svn add is run
authorAlex Tarkovsky <alextarkovsky@gmail.org>
Tue, 4 Jul 2006 16:02:52 +0000 (16:02 +0000)
committerAlex Tarkovsky <alextarkovsky@gmail.org>
Tue, 4 Jul 2006 16:02:52 +0000 (16:02 +0000)
svn path=/sunrise/; revision=464

scripts/sunrise-commit

index e8f31d5692a972b9f02ff4fb0287c00e92ca7aad..69afaafb13c63bef63dd36ddb0e905fb5e3fbc9f 100755 (executable)
@@ -14,7 +14,6 @@ YELLOW=$WARN
 
 commit_category="$(echo `pwd` | awk -F/ '{ print $(NF-1) }')"
 commit_package="$(echo `pwd` | awk -F/ '{ print $NF }')"
-commit_status="$(echo `svn status`)"
 num_new_dirs=0
 opt_changelog=0
 opt_noformat=0
@@ -52,7 +51,7 @@ create_digests() {
 
 repoman_check() {
        if [[ "$opt_norepoman" == "0" ]] ; then
-               if [[ "$(svn status)" =~ '\.ebuild' ]] ; then
+               if [[ "$(echo `svn status`)" =~ '\.ebuild' ]] ; then
                        ebegin "Running repoman"
                        export PORTDIR_OVERLAY="$(dirname $(dirname $(pwd)))"
                        repoman
@@ -80,7 +79,7 @@ svn_commit() {
        done
 
        if [[ "$opt_noformat" == "0" ]] ; then
-               commit_status="$(echo `svn status`)"
+               local commit_status="$(echo `svn status`)"
                if [[ "$commit_status" =~ '\.ebuild' ]] ; then
                        commit_message="${commit_category}/${commit_package}: ${commit_message}"
                else
@@ -226,15 +225,16 @@ if [[ -z "$*" ]] ; then
        exit 1
 fi
 
-if [[ -z "$commit_status" ]] ; then
-       ewarn "No changes found in current directory tree."
-       exit 1
-fi
-
 svn_up || exit $?
 [[ ! -e metadata.xml ]] && cp ../../skel.metadata.xml metadata.xml >/dev/null 2>&1
 changelog_append "$*" || exit $?
 create_digests || exit $?
 svn_add || exit $?
+
+if [[ -z "$(svn status)" ]] ; then
+       echo "!!! Error: No changes found in current directory tree. Aborting commit."
+       exit 1
+fi
+
 repoman_check || exit $?
 svn_commit "$*" || exit $?