Use local information to determine if a commit is needed

This commit is contained in:
Pierre Schmitz 2010-02-17 18:05:16 +01:00
parent 849e6c6de5
commit 53a864a5aa
1 changed files with 11 additions and 9 deletions

View File

@ -15,7 +15,7 @@ if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
exit 1
fi
if [ "$(svn diff)" != '' ]; then
if [ ! -z "$(svn status -q)" ]; then
echo 'archrelease: You have not committed your changes yet!'
echo ' Please run "svn commit" first'
exit 1
@ -23,18 +23,20 @@ fi
echo -n 'releasing package...'
pushd .. >/dev/null
url=$(svn info | grep URL)
url="${url##*URL: }"
if [ -z "$(svn diff ${url}/trunk ${url}/repos/${1} 2>/dev/null)" -a $? -eq 0 ]; then
trunk=$(LANG=C svn info trunk | grep 'Last Changed Rev:' | awk '{ print $4 }')
repo=$(LANG=C svn info "repos/${1}" 2>/dev/null | grep 'Last Changed Rev:' | awk '{ print $4 }')
if [[ ${trunk} -le ${repo} ]]; then
echo 'already done'
exit 1
fi
if [ -d repos/$1 ]; then
svn rm --force -q repos/$1
svn commit -q -m "archrelease: remove $1"
if [ -d "repos/${1}" ]; then
svn rm --force -q "repos/${1}"
svn commit -q -m "archrelease: remove ${1}"
fi
svn copy -q -r HEAD trunk repos/$1
svn commit -q -m "archrelease: copy trunk to $1"
svn copy -q -r HEAD trunk "repos/${1}"
svn commit -q -m "archrelease: copy trunk to ${1}"
popd >/dev/null
echo 'done'