用于复制提交的文件和文件夹的 SVN 挂钩?
我的 Windows 2008 服务器上运行着一个 SVN 存储库。现在它有 2 个应用程序,我们称它们为 App1 和 App2。我想将应用程序的提交文件复制到服务器上的另一个位置,每个应用程序一个。我想在提交后执行此操作,所以我认为应该使用提交后挂钩?
我如何知道哪个应用程序获取了新文件以及复制命令的外观如何? App1 的文件必须转到 c:\app1,例如 App2 的文件必须转到 c:\app2。
感谢您的帮助 :)。
I have a SVN repository running on my Windows 2008 server. It has 2 apps in it right now, lets call them App1 and App2. I want to copy the committed files for the apps to another place on the server, one for each app. I want to do that after the commit, so I think the post-commit hook is the one to use?
How do I know which app got new files and how would the copy command look? Files for App1 have to go to c:\app1 for example, files for App2 to c:\app2.
Thanks for your help :).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您最好的选择是在服务器上的某个路径中签出存储库的工作副本,并在您正确提到的
提交后
中,只需执行svn update
在签出的工作副本上。Your best bet is to have a checked out working copy of your repository on the server in some path and in the
post-commit
as you rightly mentioned, just do ansvn update
on the checked out working copy.post-commit 确实是可以使用的。
如果我们看一下 svnnotify 的示例..
看起来 $1 是 repo-path 而 $2 是 rev.. 所以您应该能够对 $1 执行正则表达式来测试它是否位于您所在的两个路径之一中感兴趣并采取相应行动(或不采取行动)
摘自:Subversion 提交后挂钩 101
post-commit is indeed the one to use.
If we look at the example for svnnotify..
Looks like $1 is the repo-path and $2 is the rev.. So you should be able to just do a regex against $1 to test if it's in one of the two paths you're interested in and take action accordingly (or, not)
Culled from: Subversion Post-Commit Hooks 101