在 Subversion 中替换整个目录树的最佳方法?
在我的 Subversion 项目中,我有一些目录,其中包含我的代码所需的其他开源项目。 例如 ffmpeg、freetype、matrixssl 和其他一些。
更新 SVN 以保存这些项目之一的最新版本的最佳方法是什么?
本质上我将执行以下操作(以 ffmpeg 为例):
1) Rename current ffmpeg folder to ffmpeg.old
2) Download new version of ffmpeg from net
3) Make sure it and my code compile and work fine together
4) Update subversion to now hold the "new" version of ffmpeg
5) Delete ffmpeg.old directory tree
Within my Subversion project I have a few directories that contain other open source projects that my code needs. For example ffmpeg, freetype, matrixssl and a few others.
What is the best way to update SVN to hold the the latest version of one of these projects?
Essentially I will be doing the following (using ffmpeg as an example):
1) Rename current ffmpeg folder to ffmpeg.old
2) Download new version of ffmpeg from net
3) Make sure it and my code compile and work fine together
4) Update subversion to now hold the "new" version of ffmpeg
5) Delete ffmpeg.old directory tree
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你可以看看 svnbook 谈论 供应商分支。 这正是您想要完成的任务。
您可以使用 svn_load_dirs.pl 来替换手动步骤 1-5。 svn_load_dirs.pl 还将跟踪新的、移动的或删除的文件。
You can take a look to svnbook talking about vendor branches. This is exactly what you try to accomplish
You can use svn_load_dirs.pl to replace your manual steps 1-5. svn_load_dirs.pl will also keep track of new, moved or deleted files.
我在使用 CMake 时遇到了同样的情况,我将二进制 win32 版本签入我们的供应商目录中:
然后我使用 svn:externals 来引用我正在使用的 CMake 版本。 使得测试升级到新版本变得非常容易,而且我正在使用哪个版本的 CMake 也很清楚。
I've got the same situation with CMake, where I keep the binary win32 release checked into our vendor directory:
I then use svn:externals to refer to the CMake version I'm using. Makes it really easy to test upgrading to new versions, and it is also clear which version of CMake I'm using.
一切都是正确的,除了您不需要步骤 1 和 5 - 如果步骤 3 无法使用 svn 恢复功能恢复更改。
All is correct except that you don't need steps 1 and 5 - if step 3 fails revert changes using svn revert functionality.
我想你有两个选择。
A)
优点:如果最新版本中不存在额外的文件,将确保不保留这些文件。
缺点:可能很耗时。
B)
Pro:您可以看到该工具的文件中发生了什么变化。
缺点:最终可能会变得混乱。 根据工具的不同,覆盖可能会导致错误。
I think you've got two options.
A)
Pro: Will make sure no extra files are kept if they are not present in the latest version.
Con: May be time consuming.
B)
Pro: You can see what has changed in the files of the tool.
Con: May end up with clutter. Depending upon the tool overwriting may cause bugs.
如果某些供应商项目也使用 Subversion,您可以添加
svn:externals 属性到您的分支/主干的父目录。
有关更多详细信息,请参阅 SVN 书籍。
If some of the vendor projects also use Subversion, You can add
the svn:externals property to the parent directory of Your branch/trunk.
Take a look at the SVN book for more details.