帮助了解SVN外部 [英] Help in understanding SVN Externals

查看:91
本文介绍了帮助了解SVN外部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为公司寻找svn外部设备,看来这对我们来说将是一个很好的功能.我们有几种产品经常引用共享组件,但有一个坏习惯,即落后于旧版本,有时甚至分支到不同的代码库.

I'm looking into svn externals for my company, and it seems like it would be a good feature for us to use. We have several products that often reference shared components, but have a bad habit of falling behind into older versions and even differently branched codebases sometimes.

我已经阅读了一些有关它们现在如何工作的内容,并且我认为我理解这个概念.我不确定100%是如何将多个存储库的不同修订版本链接在一起.

I've read a decent bit about how they work now, and I think I understand the concept OK. What I'm not 100% sure on is how different revisions of multiple repositories link together.

假设我有一个产品和一个图书馆.该产品是针对库构建的,因此其存储库具有svn:externals属性,该属性链接到库源.在svn:externals定义中没有特定版本的情况下,当我检出Product的HEAD时,我也会得到Library的HEAD.

Let's say I have a Product and a Library. The Product is built against the Library, so its repo has a svn:externals property that links to the Library source. In the absence of a specific version in the svn:externals definition, when I check out HEAD of Product I also get HEAD of Library.

多年来,我构建了多个版本的产品,每次都引用库的最新版本.虽然有一天我必须回去并通过手动选择正确的修订版来签出产品版本1.当我这样做时,会得到哪个版本的Library,HEAD或我第一次构建它时使用的修订版本?

I build several versions of Product over the years, each time referencing the latest version of Library. One day though I have to go back and check out Product version 1, by manually selecting the correct revision. When I do so, which version of Library do I get, HEAD or the revision that I used when I built it the first time?

希望我一直是一名优秀的开发人员,并记得为我发布的每个产品版本加上标签.当我将标签"Product-1-0-0"应用到存储库时,是否也标记了正确的库存储库修订版?如果以后我根据标签"Product-1-0-0"签出产品,是否可以签出正确的Library版本?

Hopefully I've been a good developer and remembered to tag every version of Product that I release. When I apply my tag 'Product-1-0-0' to the repository, does the correct revision of the Library repository get tagged too? If I later check out Product based on the tag 'Product-1-0-0', does the correct revision of Library get checked out with it?

推荐答案

使用svn:externals时要注意的是,如果要使用中继以外的其他内容,则需要明确指定修订版本.有关详细信息,请 Google"pining svn:externals" .如果您使用的是相当现代的版本,即1.5或更高版本的IIRC,则至少支持相对外部.较旧的版本,例如我当前正在使用的版本,要求我们使用每个该死的文件夹svn:externals属性上的-rNNNNN选项明确固定修订.

What you have to watch out for with svn:externals is that you need to explicitly specify the revision if you want something other than trunk. Google "pinning svn:externals" for the details. If you are using a fairly modern version, 1.5 or newer IIRC, then relative externals are at least supported. Older versions, like the one that I am currently using, requires us to explicitly pin the revision using the -rNNNNN option on the svn:externals property for every damned folder.

我们最终使用了来自tigris.org的名为svncopy.pl的perl脚本的修改来完成所有的分支和标记.并没有那么糟,但是我希望我们在决定如此大量使用它们之前已经知道有多少工作.

We ended up using a modification of a perl script named svncopy.pl from tigris.org to do all of our branching and tagging. It's not that bad but I wish that we had known how much work it was before we decided to use them so heavily.

这篇关于帮助了解SVN外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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