Using SVN post-commit hook to update only files that have been committed

前端 未结 4 1182
有刺的猬
有刺的猬 2020-12-08 02:49

I am using an SVN repository for my web development work. I have a development site set up which holds a checkout of the repository.

I have set up an SVN post-commi

4条回答
  •  心在旅途
    2020-12-08 03:36

    For Windows:

    for /F "eol=¬ delims=¬" %%A in ('svnlook dirs-changed %1 -r %2') do svn export "file:///c:/path/to/repo/%%A" "c:/svn_exports/%%A"  --force
    

    Just copy the above into your post-commit hook batch file (or window for VisualSVN) and you're done - you'll get the updated directory exported to c:\

    You could try using %1 instead of c:/path/to/repo above, but I found that it didn't work because VisualSVN give the %1 path with back-slash path separators, and svnlook gives them with forward-slashes. This doesn't seem to work right so I hard-code the repo path (I got "The filename, directory name, or volume label syntax is incorrect" errors)

提交回复
热议问题