简体   繁体   English

SVN中的版本控制

[英]Versioning in SVN

I have a situation where I would like to track versions of some of the folders in my project. 我遇到一种情况,我想跟踪项目中某些文件夹的版本。 Let's assume the following is my SVN structure 假设以下是我的SVN结构

branch name let's say is BRANCH. 假设分支名称是BRANCH。 pattern of directories - [TopFolder/SubFolder1/SubFolder2..] 目录模式-[TopFolder / SubFolder1 / SubFolder2 ..]

A/a1/a2/a3 A / A1 / A2 / A3
B
C C
D d
E Ë
F F
G/g1 G / G1
E/e1/e2 E / E1 / E2
F F

I want to make sure that when I run my tool which let's say resides in directory F - it should pick up code from G, E & C. And it should not pick up the latest code, but a blessed QA code ie a SVN revision for each of the folder. 我想确保当我运行位于目录F中的工具时-应该从G,E和C中获取代码。并且不应获取最新的代码,而应该获取受好评的QA代码,即SVN版本对于每个文件夹。

One solution is to track the svn revisions of G, E & C which are QA blessed and then svn up them to that revision before running the tool. 一种解决方案是跟踪受QA认证的G,E和C的svn修订版,然后在运行该工具之前将其修订为该修订版。

Another solution is that 另一个解决方案是
1. I create a branch BRANCH_1 which has all the things QA blessed. 1.我创建了一个分支BRANCH_1,该分支具有所有质量检查得到祝福的东西。
2. I run the tool from BRANCH_1. 2.我从BRANCH_1运行该工具。 No need to svn up anything since the latest is greatest. 因为最新是最伟大的,所以不需要整理任何东西。
3. I make code changes to BRANCH as I feel like 3.我觉得我对BRANCH进行了代码更改
4. Once BRANCH has been QA'ed, I sync BRANCH_1 with BRANCH. 4.对BRANCH进行质量检查后,我将BRANCH_1与BRANCH同步。 BRANCH_1 would not be usable while the sync is in process. 同步进行中,BRANCH_1将无法使用。

I want to hear few other ideas which can be cleaner and more robust? 我想听听其他一些更干净,更强大的想法吗? May be one which doesn't have you create branches now and then. 可能是您不时创建分支的一种。

I want to make sure that when I run my tool which let's say resides in directory F - it should pick up code from G, E & C. And it should not pick up the latest code - but a blessed QA code. 我想确保当我运行位于目录F中的工具时-应该从G,E&C中获取代码。并且不应获取最新的代码-而是受好评的质量检查代码。

I have a very difficult time understanding your question. 我很难理解您的问题。 However, you might want to use svn:externals to point your G, E, and C directories into your F directory. 但是,您可能需要使用svn:externals将G,E和C目录指向F目录。 You can (and in fact you should) point your svn:external to a particular revision of the other directories. 您可以(实际上应该)将svn:external指向其他目录的特定修订版。 For example, use the -r option to specify a particular revision or point to a tag. 例如,使用-r选项来指定特定的修订版或指向标签。

Would this help you? 这对您有帮助吗?

I see a couple straightforward ways to do this with branches. 我看到了使用分支的几种直接方法。

The first idea, is to keep two long-standing branches. 第一个想法是保留两个长期存在的分支机构。 You'd have a "dev" or "trunk" where you developers work, and you'd have a "release" or "approved" or something where QA works. 您将在开发人员工作的地方使用“开发”或“ trunk”,并在质量保证工作的地方使用了“发行”或“批准”的东西。 Periodically QA will merge changes into their branch, test them, and if the test passes, commit. 质量检查会定期将更改合并到其分支中,进行测试,如果测试通过,则提交。 Then only QA-approved changes make it to the "release" branch, while development proceeds as normal on trunk. 然后,只有经过QA批准的更改才能进入“发布”分支,而开发工作仍可以正常进行。 So, you script can always just pull the latest "release" branch code. 因此,您的脚本始终可以仅提取最新的“发布”分支代码。

The second idea, is to have a "clean trunk" process. 第二个想法是有一个“干净的主干”过程。 Every change developers make is done on a new branch. 开发人员所做的每项更改都在新分支上完成。 Before any change gets merged to trunk, QA must test and approve the change. 在将任何更改合并到主干之前,质量检查人员必须测试并批准更改。 Thus, your script can always just pull the latest "trunk" code. 因此,您的脚本始终可以仅提取最新的“ trunk”代码。 This can cause a much slower development cycle, however, and may result in a large number of merges increasing chances to introduce errors. 但是,这可能会导致开发周期大大缩短,并可能导致大量合并,从而增加了引入错误的机会。 So unless you have other reasons to prefer this process (required peer reviews before committing to trunk, for example) it may not be efficient for your team. 因此,除非您有其他理由更喜欢此过程(例如,在提交中继之前需要进行同行评审),否则对您的团队而言可能没有效率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM