使用 SVN 进行多版本开发
我的团队正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道您是否可以通过论坛上的问答来实际解决这样的情况。您最好的选择可能是寻求像我的雇主 CollabNet 这样的公司提供的专业服务。 Subversion 培训选项
让我们暂时搁置“trunk”之类的名称,因为这些名称的含义无论你想让它们表达什么意思。我是 Apache Subversion 的提交者之一,我建议像我们对 Subversion 本身所做的那样进行开发。
这种模型运作良好,因为更改总是只在一个方向合并,您不必担心有人对某个版本进行快速修复,然后忘记在主干中进行相同的修复。因此该错误不会在下一个版本中再次出现。
我要指出的是,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.
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.