diff options
author | 2006-07-02 01:37:34 +0000 | |
---|---|---|
committer | 2006-07-02 01:37:34 +0000 | |
commit | dd12f8d23a47524b288266d1efec387367a18cda (patch) | |
tree | b96fb6749a7e2dbb410a8f767ffc322378022022 /scripts | |
parent | scripts/sunrise-commit: Run svn update from topmost un-modified directory wit... (diff) | |
download | sunrise-reviewed-dd12f8d23a47524b288266d1efec387367a18cda.tar.gz sunrise-reviewed-dd12f8d23a47524b288266d1efec387367a18cda.tar.bz2 sunrise-reviewed-dd12f8d23a47524b288266d1efec387367a18cda.zip |
scripts/sunrise-commit: Fixed directory ascension for svn update; svn commit is now run from nearest un-modified dir to cwd
svn path=/sunrise/; revision=416
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/sunrise-commit | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/sunrise-commit b/scripts/sunrise-commit index 5acfb58bd..def439452 100755 --- a/scripts/sunrise-commit +++ b/scripts/sunrise-commit @@ -16,6 +16,7 @@ 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 opt_norepoman=0 @@ -66,6 +67,10 @@ svn_add() { svn_commit() { local commit_message="$*" + for (( i=num_new_dirs ; i > 0 ; i-- )) ; do + cd .. + done + if [[ "$opt_noformat" == "0" ]] ; then commit_status="$(echo `svn status`)" if [[ "$commit_status" =~ '\.ebuild' ]] ; then @@ -108,10 +113,10 @@ svn_commit() { svn_up() { if [[ "$opt_noupdate" == "0" ]] ; then - local update_package=0 - local update_category=0 - [[ "$(echo `svn status`)" =~ "A.*\." ]] && { update_package=1 ; pushd . >/dev/null ; cd .. ; } - [[ "$(echo `svn status ..`)" =~ "A.*\.\." ]] && { update_category=1 ; pushd . >/dev/null ; cd .. ; } + while [[ "$(echo `svn status`)" =~ "A.+? \." ]] ; do + pushd .. >/dev/null + (( num_new_dirs++ )) + done ebegin "Updating working copy to latest version from repository" if [[ "$opt_verbose" == "1" ]] ; then svn update || set $? @@ -119,8 +124,9 @@ svn_up() { svn update -q || set $? fi eend ${1:-0} - [[ "$update_category" == "1" ]] && popd >/dev/null - [[ "$update_package" == "1" ]] && popd >/dev/null + for (( i=$num_new_dirs ; i > 0 ; i++ )) ; do + popd >/dev/null + done fi return ${1:-0} } |