Question

With SVN I am currently exporting the contents of the repository to a test server manually using the following command on the test server (after logging in via SSH/Shell):

svn export http://svn.domain.co.uk/project /home/user/public --force

However I would like to create a post-commit script under the hooks directory which uses this same svn export command but only exports the files which have changed (including any deletes/renames/moves), otherwise each time I commit it will take too long to update the test server.

Other answers on Stack Overflow have involved the use of the svn up command which is not relevant to me as the test-server copy is not a working copy but just an export, or have involved the use of an external script (Python or Perl) which is also not what I'm looking for. Just a plain and simple bash script will do just fine ;)

Was it helpful?

Solution

You can:

  • use answer in 3-rd URL from answer in linked question (or see at version 2) (both are Bash)
  • Catch first host thomasfischer.biz, when it will be online (simpler code, export only one revision, not range, as do bash from electrictoolbox)
  • use electrictoolbox's code as base but replace svn diff by svnlook changed (at post-processing of output also) for getting changes in single revision in more clean form
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top