在 Subversion 中替换整个目录树的最佳方法?

发布于 2024-07-06 21:40:29 字数 437 浏览 4 评论 0原文

在我的 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 技术交流群。

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

发布评论

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

评论(5

極樂鬼 2024-07-13 21:40:29

你可以看看 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.

烂人 2024-07-13 21:40:29

我在使用 CMake 时遇到了同样的情况,我将二进制 win32 版本签入我们的供应商目录中:

branches/
trunk/
vendor/
    cmake/
        cmake-2.6.0/
        cmake-2.6.1/
        cmake-2.6.2/
        ...

然后我使用 svn:externals 来引用我正在使用的 CMake 版本。 使得测试升级到新版本变得非常容易,而且我正在使用哪个版本的 CMake 也很清楚。

I've got the same situation with CMake, where I keep the binary win32 release checked into our vendor directory:

branches/
trunk/
vendor/
    cmake/
        cmake-2.6.0/
        cmake-2.6.1/
        cmake-2.6.2/
        ...

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.

去了角落 2024-07-13 21:40:29

一切都是正确的,除了您不需要步骤 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.

逆光下的微笑 2024-07-13 21:40:29

我想你有两个选择。

A)

  1. SVN 删除所有文件。
  2. 获取当前& 让它起作用。
  3. SVN 添加所有文件。

优点:如果最新版本中不存在额外的文件,将确保不保留这些文件。

缺点:可能很耗时。

B)

  1. 下载并安装新版本而不是旧版本。
  2. 让它起作用。
  3. SVN 添加任何新文件。

Pro:您可以看到该工具的文件中发生了什么变化。

缺点:最终可能会变得混乱。 根据工具的不同,覆盖可能会导致错误。

I think you've got two options.

A)

  1. SVN Delete all the files.
  2. Get current & make it work.
  3. SVN Add all the files.

Pro: Will make sure no extra files are kept if they are not present in the latest version.

Con: May be time consuming.

B)

  1. Download and install the new version over the old one.
  2. Make it work.
  3. SVN add any new files.

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.

沐歌 2024-07-13 21:40:29

如果某些供应商项目也使用 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.

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