使用 SVN 进行多版本开发

发布于 2024-12-05 18:31:17 字数 925 浏览 0 评论 0原文

我的团队正在使用 SVN 来管理他们的源代码控制。我的任务是看看是否有办法改进我们使用 SVN 的方式。

我读过很多 SVN 书籍,并对其他人如何使用 SVN 进行了大量研究。

我将概述我们如何使用 svn,希望有人能给我一些建议。

首先,我们每一两个月都会发布一个版本。因此,目前我们使用主干作为代码的生产副本,并为每个计划的交付和每个生产修复创建一个发布分支。

我们通常会同时进行两个、有时三个预定的交付。例如,我可能正在为版本 3 编码,但我或其他人正在测试版本 2 并为版本 1 进行最终的错误修复。同时可能还会进行生产修复。

现在我们做了很多合并来保持分支(每个版本)同步。版本 3 需要版本 2 和版本 1 中的代码,但我们显然不希望版本 3 中的新代码进入版本 1。因此,我们将进行一系列从版本 1 到版本 2、从版本 2 到版本 3 的合并。必须定期重复,以便版本 3 的编码人员拥有版本 2 或版本 1 的错误修复。

每当版本或生产修复投入生产时,我们都会将代码合并回主干。然后我们将它从主干(或刚刚投入生产的发布分支)合并到所有活动分支中。

您可能已经注意到,我们花了很多时间进行合并。

对于控制源代码控制的人员来说,这是一项艰巨的工作。他们不断地进行合并,并确保跟踪哪些分支在哪里合并。

看起来 SVN 作为我们的源代码控制管理系统(我知道它实际上只是版本控制,但我们使用它来管理我们的源代码控制)应该能够帮助我们解决这个问题。

例如,如果从事版本 3 的开发人员知道版本 2、版本 1 或主干上的某些内容何时发生更改,并且可以自动通知该开发人员,并且他可以进行合并以将更改放入他的分支中,那就太好了。但相反,必须有人知道手动进行所有合并……似乎人类做了太多工作,而机器做得还不够。

有谁知道我们如何能够更好地利用 SVN 的功能,这样我们就可以避免一些令人头痛的事情,并确保每个人始终使用他们应该使用的代码版本!

谢谢!

My team is using SVN to manage their source control. I have been given the task to see if there is anyway to improve the way in which we use SVN.

I have read much of the SVN book and done a lot of research into how others use SVN.

I'm going to give an overview on how we use svn and hopefully someone has some suggestions for me.

First of all, we have a release every month or two. So currently we use the trunk as our production copy of the code and we create a release branch for each scheduled delivery and for each production fix.

We usually have two, sometimes three scheduled deliveries going at the same time. For example I might be coding for release 3, but I or others are testing for release 2 and doing final bug fixes for release 1. There might also be a production fix going on at the same time.

Right now we do a lot of merges to keep the branches(each release) in sync. Release 3 needs the code from 2 and 1, but we obviously don't want new code from release 3 getting into release 1. So we would do a series of merges from release 1 to release 2 and from release 2 to release 3. This would have to be repeated on a regular basis to that coders on release 3 have and bug fixes from 2 or 1.

Whenever a release or production fix goes into production we merge the code back into the trunk. Then we merge it from the trunk (or the release branch that just went to production) into all the active branches.

As you might have noticed we spend a lot of time merging.

This is a lot of work for the person in control of the source control. They are constantly doing merges and making sure they keep track of which branches are merged where.

It seems like SVN as our source control management system (I know it's really only version control, but we are using it to manage our source control) should be able to help us out with this.

For example, it would be great if the developer working on Release 3 knew when something changed on release 2, release 1, or the trunk and that developer could be automatically notified and he could do a merge to get the changes into his branch. But instead someone has to know to do all the merges manually... Seems like the human is doing too much work and the machine is not doing enough.

Does anyone have any ideas on how we might be able to better utilize SVN's features so we could save ourselves some of this headache, and make sure that everyone is always working with the versions of code they are supposed to be!

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

财迷小姐 2024-12-12 18:31:17

我不知道您是否可以通过论坛上的问答来实际解决这样的情况。您最好的选择可能是寻求像我的雇主 CollabNet 这样的公司提供的专业服务。 Subversion 培训选项

让我们暂时搁置“trunk”之类的名称,因为这些名称的含义无论你想让它们表达什么意思。我是 Apache Subversion 的提交者之一,我建议像我们对 Subversion 本身所做的那样进行开发。

  1. 事实上,所有开发都是在一个我们称为主干的位置完成的,但也可以称为“开发”或“不稳定”或任何您想要的名称。
  2. 一些新功能的工作将在从主干创建的功能分支上完成。这些通常是短暂的,由开发商自行决定。我们尝试始终保持主干稳定(所有测试都通过),因此有时人们希望首先在分支上尝试破坏性更改。
  3. 在某个时候,我们认为 trunk 已经获得了我们想要的功能,是时候发布版本了,因此通过复制 trunk 创建一个发布分支。
  4. 我们不允许在发布分支中进行任何开发。错误已在主干中修复,并且包含修复的修订版被提名向后移植到一个或多个版本。如果获得批准,则修订将合并到它们被批准的发布分支。
  5. 有时,主干与发布版本的差异很大,以至于修复程序无法完全合并。发生这种情况时,我们通过复制发布分支然后将修复从主干合并到向后移植分支来创建向后移植分支。这使得开发人员能够适当地解决分支上的合并冲突,并且其他开发人员能够正确地审查并投票决定是否应该向后移植该错误。

这种模型运作良好,因为更改总是只在一个方向合并,您不必担心有人对某个版本进行快速修复,然后忘记在主干中进行相同的修复。因此该错误不会在下一个版本中再次出现。

我要指出的是,Subversion 的开发是相当线性的。正如您在上面指出的那样,我们没有正在发布 3 个版本。我们仍然一次支持 3 个版本,但向后移植的修复数量很少。我认为这个过程可以适用于像您所描述的更加流动的环境,但我认为当您尝试解决问题时,最好有一个服务专业人员与您更密切地合作。

I do not know that you can realistically work out a situation like this via questions and answers on a forum. Your best option might be to look at Professional Services from a company like my employer, CollabNet. Subversion Training Options

Let's set aside names like "trunk" for a moment as these things mean whatever you want them to mean. I am one of the committers for Apache Subversion and I would recommend doing development somewhat like we do for Subversion itself.

  1. Virtually all development is done in a single location that we call trunk, but could be called "development" or "unstable" or whatever name you want.
  2. Some work on new features will be done on feature branches created from trunk. These are generally short lived and at the discretion of the developer. We try to keep our trunk stable at all times (all tests pass), so sometimes people want to try disruptive changes on a branch first.
  3. At some point, we think trunk has gotten the features we want to a point that it is time to make a release, so a release branch is created by copying trunk.
  4. We do not allow any development to happen in the release branch. Bugs are fixed in trunk, and the revision(s) that contain the fix are nominated for backport to one or more releases. If approved, then the revision(s) are merged to the release branch(s) they were approved for.
  5. Occasionally, trunk has diverged enough from the release that a fix will not merge cleanly. When this happens we make a backport-branch by copying the release branch and then merging the fix from trunk to the backport-branch. This allows the developer the ability to appropriately resolved the merge conflicts on the branch and the other developers to properly review and vote for whether the bug should be backported.

This model works well because changes always only merge in one direction and you do not have to worry about someone making a quick fix for some release and then forgetting to make that same fix in trunk. So the bug does not show back up in the next release.

I will point out that Subversion development is fairly linear. We do not have 3 releases in flight as you indicate above. We do still support 3 releases at a time, but the number of fixes being backported is small. I think this process could work for a more fluid environment like you describe, but I think you would be better off having a services professional to work with more closely as you try to iron it out.

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