"svn:externals"有什么好处? [英] What's the benefits of "svn:externals"?

查看:233
本文介绍了"svn:externals"有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我还没有遇到

I would not get to know svn:externals if I haven't run into the this page. So, I setup my working folder. Then

mkdir lib/vendor
svn add --parents lib/vendor
svn ps svn:externals 'symfony http://svn.symfony-project.com/branches/1.4/' lib/vendor/
svn ci -m "add externals"
svn update

"svn更新"列出​​了整个symfony文件夹,并且运行缓慢.我认为那将是一次痛苦.但是,每次我输入"svn up"时,SVN都会检查外部存储库.我必须使用--ignore-externals来使"svn更新"足够快.

The "svn update" enlists the whole symfony folder and is pretty slow. I thought that would be single time pain. However, SVN will check external repository every time I typed "svn up". I have to use --ignore-externals to make "svn update" fast enough.

我想知道svn:externals这么慢有什么好处.我宁愿将symfony复制到我自己的存储库中,这肯定是一个更快的解决方案.

I'm wondering what's the benefits of svn:externals if it is so slow. I'd rather copy symfony to my own repository, which is surely a faster solution.

推荐答案

SVN外部因素也与项目组织有很大关系.外部设备可以是完全不同的SVN存储库,这意味着您可以设置不同类型的安全性,保护,访问,预提交挂钩,后提交挂钩等.对于其中的不同文件夹,很难进行不同级别的访问单个SVN存储库(没有 VisualSVN 之类的帮助),这非常困难(可能不明智) )尝试对单个SVN存储库中的不同文件夹执行不同的备份或安全方法.外部变量使我们可以通过单个svn up将多个不同的存储库缝合在一起,从而为我们提供了更大的自由度.

SVN externals also have a lot to do with project organization. Externals can be completely different SVN repos, which means you can set up different types of security, protection, access, pre-commit hooks, post-commit hooks, etc... It's difficult to do different levels of access for different folders inside of a single SVN repo (without the help of something like VisualSVN), and it's very difficult (and possibly unwise) to try and do different backup or security method for different folders inside of a single SVN repo. Externals allow us more freedom by allowing us to stitch together several different repositories with a single svn up.

Subversion外部使用案例:

  1. 一个常见的用例是外部包含一个库或其他一些不可变的代码.如果您有一个.dll,则可以绝对将其放入SVN存储库中,并将其视为代码库的一部分,但是您已经掩盖了以下事实:该.dll应该被视为只读,而不是由您或您的团队开发.

  1. A common use case is for an external to contain a library or some other piece of immutable code. If you have a .dll you can absolutely just plop it into your SVN repo and treat it as part of your code-base, but you've covered up the fact that the .dll should be treated as read-only and wasn't developed by you or your team.

另一种用例(您已经发现)是允许您的库保留在删除存储库中-可能是由活动的开源项目维护的.在这种情况下,您始终可以指向外部的特定版本,而不必担心自己存储它.

Another use case (which you have discovered) is to allow your libraries to remain on a remove repository - perhaps one maintained by an active open source project. In this case you could always point to a specific version of an external and not worry about storing it yourself.

最后,外部设备可以插入主干,分支或标签,这意味着您可以使用它们将由您自己模块的不同标记版本组成的项目缝合在一起.这将更接近于模拟Rational ClearCase或任何其他大型版本控制系统.为此,您可以为代码库的每个模块或组件维护一个SVN存储库,为每个模式/组件创建一个标签,然后使用主存储库的externals属性引用这些标签-存在该属性只是为了将它们组合在一起进入一个工作项目.

Finally, externals can pull in trunk, branches, or tags, which means that you can use them to stitch together a project that is composed of different tagged versions of your own modules. This would more closely mimic something like Rational ClearCase or any other large Version Control System. You would do this by maintaining an SVN repo for each module or component of your code-base, create a tag of each mode/component, and then reference the tags using the externals property of a master repository - which exists just to pull them together into a working project.

这篇关于"svn:externals"有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆