3

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 ;)

Jasdeep Khalsa
  • 6,740
  • 8
  • 38
  • 58
  • possible duplicate of [How to overwrite several multi-level(different hierarchy) files from a local version to an online version via FTP](http://stackoverflow.com/questions/13058444/how-to-overwrite-several-multi-leveldifferent-hierarchy-files-from-a-local-ver) – Lazy Badger Jan 20 '13 at 02:05
  • When you say it will take too long to long to update the test server do you mean that the the time to do the full export is simply too long for changes to appear? or you're not willing to have the test system be wonky during the time it takes to do the export? – thekbb Jan 20 '13 at 22:08
  • Yeh the first one - time to do the update is too long. Or I guess, its a lot of wasted time because why replace ALL the files when one need only replace a few? – Jasdeep Khalsa Jan 21 '13 at 09:29

1 Answers1

0

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
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110