On Thu, Jul 4, 2013 at 3:04 PM, David Schweikert <da...@schweikert.ch> wrote: > Hi, > > We have a svn repository with many files (more than 30'000), and need to > have the HEAD version exported to a filesystem, whenever a commit is > done. > > Currently, we have implemented this with a post-commit script that does > a "svn update", but the script is rather slow. The reason is that "svn > update" apparently checks the whole tree for any local changes. In our > case, we can however guarantee that no changes are done in the working > copy. > > I was thinking that we could use something like a "svn update > --readonly", where svn doesn't any check anything on the working copy, > but just applies any changes committed since the last update. > > An alternative would be to implement a special mode for "svn export", > which writes a file with the exported revision number (".revision" in > the root directory, for example), and a "svn export-update" that only > fetches any changed files between the last exported version and HEAD. It > could even be a completely separate binary which uses libsvn... > > What are your thoughts on this? We have computer engineering students > that could be put on such a project, but it would be great to have some > guidance on whether this is a good idea and what you would recommend > doing.
First thing to check IMO is whether the latest svn client isn't already fast enough with a normal 'svn update'. Which svn client version are you using? On what platform and filesystem? The recently released 1.8 version has an exclusive locking mode [1], which makes it very fast if you're sure that there will only be a single process accessing the working copy simultaneously. Also, make sure that the timestamps of the on-disk files are not changed by some other process after the checkout or update (otherwise, svn has to read / checksum the file contents to make sure they weren't changed --- if both filesize and last-mod-time remain unchanged after checkout/update, svn will optimize this, assuming the file wasn't changed). [1] http://subversion.apache.org/docs/release-notes/1.8.html#exclusivelocking -- Johan