Subversion:自动备份或从服务器复制

发布于 2024-10-07 04:40:39 字数 237 浏览 0 评论 0原文

我们的网站上运行着一个 subversion 的 collabnet 实例。我们还有一家为我们工作的第三方公司。他们使用托管在 beanstalk 上的 subversion。

如果我们每天晚上都能以某种方式将 beanstalk 上的 trunk 文件夹的副本移动到我们自己的颠覆中,那就太好了。

有谁知道这是否可能,或者至少是否可以自动化并转储到 Windows 文件夹中?

提前致谢,

吉姆

We have a collabnet instance of subversion running on our site. We also have a third party company who do work for us. They use subversion hosted on beanstalk.

It would be great if we could somehow, each night, move a copy of the trunk folder on beanstalk into our own subversion.

Does anyone know if this is possible, or at least if it would be possible to automate and just dump into a windows folder?

Thanks in advance,

Jim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬シ愛 2024-10-14 04:40:39

您可以使用

svnadmin dump trunk > trunk.dmp

then

svnadmin load --parent-dir remote trunk < trunk.dmp

这将从服务器中将主干导出到一个文件中,然后将其再次导入到存储库的父目录“remote”下。您可能需要编写此脚本,以便在父文件夹或类似的文件夹中包含日期。这可能会导致您的存储库增长,因为您一遍又一遍地导入类似的代码。您可以做的一件事是加载一次,然后将代码检出到工作文件夹中,然后使用

svn switch --relocate <from url> <to url> .

这个想法是切换到远程,签出,切换到本地,签入。我还没有测试了类似的东西,所以它可能不会以这种方式工作。至少您应该能够保留两个工作文件夹,一个用于本地,一个用于远程,并将简单的文件复制到目标并签入。这一切都可以通过编写 svn.exe 命令脚本来自动化。

或者,如果只是在工作文件夹中提供代码,您可以通过每天从他们的存储库中签出来保持他们的代码同步。只需使用以下命令即可自动执行此操作:

svn co <path to server> <path to working folder>

如果将此命令设置为作为计划任务运行,那么您将始终在一天结束时在工作文件夹中拥有最新的代码。

You could use

svnadmin dump trunk > trunk.dmp

then

svnadmin load --parent-dir remote trunk < trunk.dmp

This will export the trunk from the server in a file and import it again on your repository under the parent directory 'remote'. You'll probably want to script this so that you have the date in the parent folder or something like that. This might cause your repo to grow though since you are importing similar code over and over. One thing that you could do would be to do the load once and then check the code out into a working folder and then use

svn switch --relocate <from url> <to url> .

The idea is to switch to the remote, check out, switch to the local, check in. I haven't tested anything like this so it might not work quite this way. At the very least you should be able to keep two working folders, one for local, one for remote, and do a simple file copy into the destination and check in. This can all be automated via scripting the svn.exe command.

Alternatively if just having the code available in a working folder you could just keep their code synced by checking out from their repo every day. This could be automated just using:

svn co <path to server> <path to working folder>

If this command is set to run as a scheduled task you would always have their latest code at the end of the day in the working folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文