From: <baz...@us...> - 2008-02-07 22:33:58
|
Revision: 7779 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7779&view=rev Author: bazaarmagetron Date: 2008-02-07 14:33:59 -0800 (Thu, 07 Feb 2008) Log Message: ----------- The branch used for development of this went out of sync with SVN for branching scheme changes. Oh well. Here are the contents. Modified Paths: -------------- tools/bzr/trunk/synctools/README tools/bzr/trunk/synctools/config.sh tools/bzr/trunk/synctools/geturis.sh tools/bzr/trunk/synctools/mirror.sh tools/bzr/trunk/synctools/sync.sh Added Paths: ----------- tools/bzr/trunk/synctools/bzr-commit.sh tools/bzr/trunk/synctools/bzr-edit.sh tools/bzr/trunk/synctools/bzr-merge.sh tools/bzr/trunk/synctools/cron.sh tools/bzr/trunk/synctools/onemirror.cfg Property Changed: ---------------- tools/bzr/trunk/ Property changes on: tools/bzr/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-07 23:01:45.862999916 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: tools-bzr-trunk-work + timestamp: 2008-02-07 23:10:08.970999956 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: tools-bzr-trunk-work Name: bzr:file-ids - + synctools/cron.sh cron.sh-20080207220513-ia7nz94u9sn2udin-4 synctools/bzr-edit.sh bzredit.sh-20080207220513-ia7nz94u9sn2udin-2 synctools/onemirror.cfg onemirror.cfg-20080207220513-ia7nz94u9sn2udin-5 synctools/bzr-commit.sh bzrcommit.sh-20080207220513-ia7nz94u9sn2udin-1 synctools/bzr-merge.sh bzrmerge.sh-20080207220513-ia7nz94u9sn2udin-3 Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 11 z-...@us...-20080207161753-lxmjabk915rkcdmz 12 z-...@us...-20080207162744-4riit8379zi13ekd 13 z-...@us...-20080207220145-74cas2qumuyn2vcn + 11 z-...@us...-20080207161753-lxmjabk915rkcdmz 12 z-...@us...-20080207162744-4riit8379zi13ekd 13 z-...@us...-20080207220145-74cas2qumuyn2vcn 14 z-...@us...-20080207221008-zhs110iw1vtreysm Modified: tools/bzr/trunk/synctools/README =================================================================== --- tools/bzr/trunk/synctools/README 2008-02-07 22:33:28 UTC (rev 7778) +++ tools/bzr/trunk/synctools/README 2008-02-07 22:33:59 UTC (rev 7779) @@ -16,3 +16,17 @@ There are also the individual scripts mirror.sh and sync.sh that let you mirror an svn branch and keep it in sync. + +The branching scheme you should set with +"bzr svn-branching-scheme https://armagetronad.svn.sourceforge.net/svnroot/armagetronad --set" + +is: +*/trunk/* +*/branches/*/* +*/tags/*/* +tools/*/trunk + +It also pays to do a dry run first with a local copy of the SF SVN +repository. The intial pull and push from there take quite a while. +You can delete the resulting branches afterwards; the important thing +is that your cache in ~/.bazaar/svn-cache is filled. Added: tools/bzr/trunk/synctools/bzr-commit.sh =================================================================== --- tools/bzr/trunk/synctools/bzr-commit.sh (rev 0) +++ tools/bzr/trunk/synctools/bzr-commit.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -0,0 +1,11 @@ +#!/bin/bash + +# bend editor to script that copies merge metadata into commit message +test -z "$EDITOR" && EDITOR=editor +export ORIGINAL_EDITOR=$EDITOR +export EDITOR="$(dirname $0)/bzr-edit.sh" + +# and commit +bzr commit + + Property changes on: tools/bzr/trunk/synctools/bzr-commit.sh ___________________________________________________________________ Name: svn:executable + * Added: tools/bzr/trunk/synctools/bzr-edit.sh =================================================================== --- tools/bzr/trunk/synctools/bzr-edit.sh (rev 0) +++ tools/bzr/trunk/synctools/bzr-edit.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -0,0 +1,21 @@ +#!/bin/bash + +# make backup of message +mv "$1" "$1.back" + +# add newline +echo > "$1" + +# paste merge information +PENDING="^pending merges:" +grep "$PENDING" < "$1.back" -A 2000000 | sed -e "s/$PENDING/merging:/" >> "$1" + +# and append regular message +grep "\-" < "$1.back" -A 2000000 >> "$1" + +# remove traces +rm -f "$1.back" + +# call original editor +$ORIGINAL_EDITOR "$@" + Property changes on: tools/bzr/trunk/synctools/bzr-edit.sh ___________________________________________________________________ Name: svn:executable + * Added: tools/bzr/trunk/synctools/bzr-merge.sh =================================================================== --- tools/bzr/trunk/synctools/bzr-merge.sh (rev 0) +++ tools/bzr/trunk/synctools/bzr-merge.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -0,0 +1,10 @@ +#!/bin/bash + +# try to fetch changes +bzr pull "$@" && exit 0 + +# merge them if required +bzr merge "$@" || exit 1 + +# commit directly if there are no conflicts +$(dirname $0)/bzr-commit.sh Property changes on: tools/bzr/trunk/synctools/bzr-merge.sh ___________________________________________________________________ Name: svn:executable + * Modified: tools/bzr/trunk/synctools/config.sh =================================================================== --- tools/bzr/trunk/synctools/config.sh 2008-02-07 22:33:28 UTC (rev 7778) +++ tools/bzr/trunk/synctools/config.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -2,3 +2,6 @@ BZRROOT=bzr+ssh://z-...@ba.../~armagetronad-dev/armagetronad SVNROOT=https://armagetronad.svn.sourceforge.net/svnroot/armagetronad +#SVNROOT=file:///home/darcsmaster/armagetron/svn/mirror/svn +#SVNROOT=svn+ssh://darcsmaster@proxy/home/darcsmaster/armagetron/svn/mirror/svn +#BZRROOT=/home/darcsmaster/armagetron/launchpad2 Added: tools/bzr/trunk/synctools/cron.sh =================================================================== --- tools/bzr/trunk/synctools/cron.sh (rev 0) +++ tools/bzr/trunk/synctools/cron.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -0,0 +1,12 @@ +#!/bin/bash + +# usage: cron.sh + +# to be called as cronjob + +cd $(dirname $0) + +# execute syncing, only print on error +mkdir -p logs +log="logs/$(date)" +nice -n 5 ./all.sh mirror.cfg > "${log}" 2>&1 || cat "${log} Property changes on: tools/bzr/trunk/synctools/cron.sh ___________________________________________________________________ Name: svn:executable + * Modified: tools/bzr/trunk/synctools/geturis.sh =================================================================== --- tools/bzr/trunk/synctools/geturis.sh 2008-02-07 22:33:28 UTC (rev 7778) +++ tools/bzr/trunk/synctools/geturis.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -1,5 +1,6 @@ # calculates URIs and other info from the $svnbranch variable +#set -x bzrbranch="$(echo $svnbranch | sed -e 's,/,-,g' | sed -e 's,^armagetronad-,,' | sed -e 's,^branches-,,')" bzrbranch_local="branches/$bzrbranch" bzrbranch_full="$BZRROOT/$bzrbranch"-work Modified: tools/bzr/trunk/synctools/mirror.sh =================================================================== --- tools/bzr/trunk/synctools/mirror.sh 2008-02-07 22:33:28 UTC (rev 7778) +++ tools/bzr/trunk/synctools/mirror.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -32,6 +32,9 @@ bzr branch "${bzrbranch_local}-sync" "${bzrbranch_local}-work" || exit 1 echo pushing work branch to remote URI... -bzr push -d "${bzrbranch_local}-work" "${bzrbranch_full}" || exit 1 + bzr push -d "${bzrbranch_local}-work" "${bzrbranch_full}" || exit 1 +echo making backup of successful operation... +bzr branch "${bzrbranch_local}-sync" "${bzrbranch_local}-backup" || exit 1 + echo done! Added: tools/bzr/trunk/synctools/onemirror.cfg =================================================================== --- tools/bzr/trunk/synctools/onemirror.cfg (rev 0) +++ tools/bzr/trunk/synctools/onemirror.cfg 2008-02-07 22:33:59 UTC (rev 7779) @@ -0,0 +1,2 @@ +private/z-man/test/bzr/trunk + Modified: tools/bzr/trunk/synctools/sync.sh =================================================================== --- tools/bzr/trunk/synctools/sync.sh 2008-02-07 22:33:28 UTC (rev 7778) +++ tools/bzr/trunk/synctools/sync.sh 2008-02-07 22:33:59 UTC (rev 7779) @@ -25,56 +25,69 @@ echo syncing branch $svnbranch: +workdir=$(pwd) + +lastsuccess=true +test -r "${bzrbranch_local}-error" && lastsuccess=false +touch "${bzrbranch_local}-error" + echo pulling changes from svn... -bzr pull -d "${bzrbranch_local}-sync" "${svnbranch_full}" | tee svnlog || exit 1 +if ! bzr pull -d "${bzrbranch_local}-sync" "${svnbranch_full}" > svnlog; then + cat svnlog + echo perhaps this helps: rebasing sync branch to svn... + set -x + pushd "${bzrbranch_local}-sync" > /dev/null + bzr rebase "${svnbranch_full}" || exit 1 + popd > /dev/null + echo retry: pulling changes from svn... + bzr pull -d "${bzrbranch_local}-sync" "${svnbranch_full}" > svnlog || exit 1 + set +x +fi +cat svnlog -echo pulling changes from remote bzr work branch... -if ! bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_full}" | tee bzrlog; then - echo Errors encountered during remote pulling. Someone probably has pushed changes to \"${bzrbranch_full}\" without rebasing. Shame on him. - echo Trying to automatically resolve the errors by repeated rebasing. - set -x - bzr branch "${bzrbranch_local}-work" "${bzrbranch_local}-fix" || exit 1 - pushd "${bzrbranch_local}-fix" - bzr rebase "${bzrbranch_full}" || exit 1 - bzr merge --pull "${bzrbranch_full}" || exit 1 - bzr rebase "../${bzrbranch}-sync" || exit 1 - popd - bzr push "${bzrbranch_local}-fix" "${bzrbranch_full}" || exit 1 - bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_full}" || exit 1 - set +x +if ! test -z "$(cat svnlog | grep '^Now on')" || test ${lastsuccess} = false; then + echo pulling changes from sync to work branch... + if ! bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_local}-sync"; then + echo perhaps this helps: rebasing work branch to sync branch... + set -x + pushd "${bzrbranch_local}-work" > /dev/null + bzr rebase "${workdir}/${bzrbranch_local}-sync" || exit 1 + popd > /dev/null + echo retry: pulling changes from sync to work branch... + bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_local}-sync" || exit 1 + set +x + fi fi -if test -z "$(cat svnlog bzrlog | grep '^Now on')"; then +echo pulling changes from remote bzr work branch... +pushd "${bzrbranch_local}-work" > /dev/null +EDITOR="echo" ${workdir}/$(dirname $0)/bzr-merge.sh "${bzrbranch_full}" > ${workdir}/bzrlog || exit 1 +popd > /dev/null +cat bzrlog + +if test -z "$(cat svnlog bzrlog | grep '^Now on')" && test ${lastsuccess} = true; then echo Nothing to do. - rm -f svnlog bzrlog - exit 0 + rm -f svnlog bzrlog "${bzrbranch_local}-error" + #exit 0 fi rm -f svnlog bzrlog -echo pulling from synced branch to work branch... -if ! bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_local}-sync"; then - echo rebasing local work branch... - pushd "${bzrbranch_local}-work" 2>&1 > /dev/null - if ! bzr rebase "${bzrbranch_local}-sync"; then - echo - echo Errors encountered during rebasing. Please correct them, finish the rebase with \"bzr rebase-continue\", then call \"sync.sh $1\" again. - exit 1 - fi - echo - popd 2>&1 >/dev/null - - echo pulling from synced branch to work branch again... - bzr pull -d "${bzrbranch_local}-work" "${bzrbranch_local}-sync" || exit 1 -fi - echo pushing work branch to remote bzr branch... bzr push -d "${bzrbranch_local}-work" "${bzrbranch_full}" || exit 1 -echo pulling changes to sync branch... -bzr pull -d "${bzrbranch_local}-sync" "${bzrbranch_local}-work" || exit 1 +echo pulling work branch to sync branch... +bzr push -d "${bzrbranch_local}-work" "${bzrbranch_local}-sync" || exit 1 echo pushing sync branch to SVN... bzr push -d "${bzrbranch_local}-sync" "${svnbranch_full}" || exit 1 +echo making backup of successful operation... +if test -d "${bzrbranch_local}-backup"; then + bzr pull -d "${bzrbranch_local}-backup" "${bzrbranch_local}-sync" || exit 1 +else + bzr branch "${bzrbranch_local}-sync" "${bzrbranch_local}-backup" || exit 1 +fi + echo done! +rm -f "${bzrbranch_local}-error" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |