Create svn repository dump


/ Published in: DOS Batch
Save to your folder(s)

Batch script creates repository dump of specific project in repository. It assumes that repository has following structure:

/project1
/trunk
/tags
/branches

/project2
/trunk
/tags
/branches
...
/projectN
/trunk
/tags
/branches

Needs UnxUtils installed to be executed successfully(http://unxutils.sourceforge.net/)


Copy this code and paste it in your HTML
  1. @ECHO OFF
  2. REM script dumps specific project by getting it from the repository
  3.  
  4. IF "%1"=="" (
  5. ECHO "Usage: %0 project"
  6. GOTO END
  7. )
  8. svn list file:///%cd:\=/%/ | grep ^%1/ > tmp.file
  9. set /p grepResult=<tmp.file
  10. del tmp.file
  11. IF "%grepResult%"=="" (
  12. ECHO There is no '%1' project in the current repository
  13. GOTO END
  14. )
  15. svnadmin dump . > repo.dump
  16. svndumpfilter include %1/ < repo.dump > %1.dump
  17. ECHO Project '%1' has been successfully dumped to file %1.dump
  18. :END

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.