https://svn.lrde.epita.fr/svn/lrde-tools/trunk/build-farm
This should solve most of our problems since Subversion release 1.4.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Use ,latest-svn-revision instead of .svn/entries to get the latest
revision number.
* buildfarm_worker/build_test.fns (fetch_svn): Rename as...
(fetch_latest_svn_revision): ...this.
Fetch ,latest-svn-revision.
(test_tree): s/svn_entry/latest_svn_revision/g.
Update uses of $latest_svn_revision.
build_test.fns | 73 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 61 insertions(+), 12 deletions(-)
Index: buildfarm_worker/build_test.fns
--- buildfarm_worker/build_test.fns (revision 435)
+++ buildfarm_worker/build_test.fns (working copy)
@@ -129,11 +129,12 @@
}
############################
-# fetch the latest copy of the svn entries file
-fetch_svn() {
+# Fetch the latest Subversion revision number from the master's
+# working copy.
+fetch_latest_svn_revision() {
file="$1"
$RSYNC -q -clpz --ignore-errors \
- $RSYNC_HOST::pool/$tree/.svn/entries "$file" 2> /dev/null
+ $RSYNC_HOST::pool/$tree/,latest-svn-revision "$file" 2> /dev/null
if [ -r $file ]; then
chmod u+w $file
return 0;
@@ -492,7 +493,7 @@
sum="build.$tree.sum"
sum_dep="build.$tree.sum_dep"
- svn_entry="svn.$tree"
+ latest_svn_revision="svn.$tree"
lck="build.$tree.lck"
srcdir="$build_root/$tree"
must_go_on=0
@@ -540,11 +541,59 @@
fi
mv $sum_dep.new $sum_dep
- # check if svn revision was incremented, if there
- # is a svn entry file.
- if fetch_svn "$svn_entry"; then
- rev=`grep "committed-rev=" $svn_entry | head -n 1 | cut -d'"'
-f2`
- revold=`grep "committed-rev=" $svn_entry.old 2> /dev/null | head -n 1 | cut
-d'"' -f2`
+ # Check if the SVN revision number was incremented, if there is a
+ # `,latest-svn-revision' file.
+ #
+ # The format of the Entries file (.svn/entries in working copies)
+ # has changed over time. Now, with Subversion 1.4, the XML format
+ # has been dropped, and this function had ceased to work. This
+ #
+ # More information can be found here:
+ #
+ #
http://svnbook.red-bean.com/en/1.4/svn.developer.insidewc.html#svn.develope…
+ #
+ # The format of the .svn/entries file has changed over time.
+ # Originally an XML file, it now uses a custom-though still
+ # human-readable-file format. While XML was a great choice for
+ # early developers of Subversion who were frequently debugging
+ # the file's contents (and Subversion's behavior in light of
+ # them), the need for easy developer debugging has diminished as
+ # Subversion has matured, and has been replaced by the user's
+ # need for snappier performance. Be aware that Subversion's
+ # working copy library automatically upgrades working copies
+ # from one format to another-it reads the old formats, and
+ # writes the new-which saves you the hassle of checking out a
+ # new working copy, but can also complicate situations where
+ # different versions of Subversion might be trying to use the
+ # same working copy.
+ #
+ # and here:
+ #
+ #
http://subversion.tigris.org/svn_1.4_releasenotes.html
+ #
+ # Working copy performance improvements (client)
+ #
+ # The way in which the Subversion client manages your working
+ # copy has undergone radical changes. The .svn/entries file is
+ # no longer XML, and the client has become smarter about the way
+ # it manages and stores property metadata.
+ #
+ # As a result, there are substantial performance improvements.
+ # The new working copy format allows the client to more quickly
+ # search a working copy, detect file modifications, manage
+ # property metadata, and deal with large files. The overall
+ # disk footprint is smaller as well, with fewer inodes being
+ # used. Additionally, a number of long standing bugs related to
+ # merging and copying have been fixed.
+ #
+ # WARNING: A Subversion 1.4 client will upgrade older working
+ # copies to the new format WITHOUT WARNING, rendering them
+ # unreadable by older Subersion clients. See the section above,
+ # titled 'Working Copy Format Changes'.
+ #
+ if fetch_latest_svn_revision "$latest_svn_revision"; then
+ rev=`cat "$latest_svn_revision"`
+ revold=`cat "$latest_svn_revision.old"`
if [ $must_go_on -eq 0 ] && [ "x$rev" = "x$revold" ]
then
echo "skip: $tree nothing changed in svn"
@@ -554,8 +603,8 @@
return
fi
echo "rebuild, svn entry changed (forced: $must_go_on, cur_rev: $rev, old_rev:
$revold)"
- rm -f "$svn_entry.old"
- cp "$svn_entry" "$svn_entry.old"
+ rm -f "$latest_svn_revision.old"
+ cp "$latest_svn_revision" "$latest_svn_revision.old"
fi
# pull the tree
@@ -565,7 +614,7 @@
# see if we need to rebuild based on file listing,
# only if there is no svn revision
- if [ ! -f "$svn_entry" ]; then
+ if [ ! -f "$latest_svn_revision" ]; then
sum_tree "$sum.new"
if [ $must_go_on -eq 0 ] && \
cmp -s "$sum.new" "$sum" 2> /dev/null