From d87c6c9cef12c3d23521c8cb32259624e497aa7e Mon Sep 17 00:00:00 2001 From: Stefan Schweizer Date: Fri, 1 Sep 2006 15:06:34 +0000 Subject: allow ./review w/o argument svn path=/sunrise/; revision=1092 --- scripts/review | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/review b/scripts/review index 3123c9f2e..1a017c56b 100755 --- a/scripts/review +++ b/scripts/review @@ -18,15 +18,7 @@ opt_verbose=0 svn_up() { if [[ "$opt_noupdate" == "0" ]] ; then - ebegin "Updating working copy to latest version from repository" - - if [[ "$opt_verbose" == "1" ]] ; then - svn update $* - else - svn update -q $* - fi - - eend $? + svn update $* local conflict_files=$(svn status | sed -rn 's/^C.+ ([^ ]+)$/\1/p') if [[ -n "$conflict_files" ]] ; then @@ -68,8 +60,6 @@ EOF exit ${1:-0} } -[[ -z "$1" ]] && usage 1 - while [[ $# > 0 ]] ; do case "$1" in --help|-h) @@ -101,15 +91,26 @@ while [[ $# > 0 ]] ; do done if [[ -z "$*" ]] ; then - echo "!!! Error: You must supply a revision. See: $0 -h" - exit 1 + ebegin "Updating working copy to latest version from repository" + update=$(svn_up) + if [[ "$opt_verbose" == "1" ]] ; then + echo $update + fi + update=$(echo $update | tail -n 1) + update=${update/At revision } + sunrise_revision=${update/.} + [ "$sunrise_revision" -lt "10" ] && exit 1 + eend #elif [[ "$*" =~ "^[0-9]*$" ]]; then # echo "!!! Error: The revision must be an integer value $*" # exit 1 -fi -sunrise_revision=$* +else + sunrise_revision=$* -svn_up -r $sunrise_revision || exit $? + ebegin "Updating working copy to latest version from repository" + svn_up -r $sunrise_revision || exit $? + eend +fi if ! [ -e sunrise ] || ! [ -e reviewed ]; then eerror "You need to have sunrise and reviewed subdirs" @@ -164,5 +165,5 @@ fi eend ${?} ebegin "Committing working copy to repository" -svn commit reviewed -m "Reviewed up to revision $*" +svn commit reviewed -m "Reviewed up to revision $sunrise_revision" eend $? -- cgit v1.2.3-65-gdbad