在 Subversion 中管理分支
我不认为我做的事情是正确的。我正在使用 Subversion 作为我们组织网站的 vcs。我是唯一的开发人员,我使用 bugzilla 作为我的错误跟踪系统。我使用 bugtraq 属性将 bugzilla 和 svn 松散耦合,这样我就可以从我的评论链接到 bugzilla。我现在正在做的是,每当我收到在网站上执行任何工作的请求(增强、修复、内容更改)时,我都会在 bugzilla 中创建一个错误 [xx],然后创建一个名为 bug[xx] 的分支。完成任务后,我手动将分支更改导出到我们的测试站点,对更改进行审核和验证,然后我将分支合并回主干,使用 bugtraq 属性指示 bug#。
这非常有效,除非我有不止一两个更改。如果我为 10 个工作请求创建了 10 个分支,我想知道如何轻松判断哪些分支已经合并到主干中,哪些没有合并到主干中。如果我应该使用看起来很疯狂的 mergeinfo 属性...
我不想从 subversion 切换,所以不建议它。
I don't think I'm doing something right. I am using subversion as my vcs for our organizations website. I am the sole developer and I'm using bugzilla as my bugtracking system. I've got bugzilla and svn loosely coupled using the bugtraq properties so that I can link from my comments to bugzilla. What I'm doing right now is whenever I get a request to perform any work on the website (enhancement, breakfix, content change) I create a bug [xx] in bugzilla then create a branch named bug[xx]. After I complete the task I manually export the branch changes to our beta site, the change is reviewed and verified then I merge the branch back into trunk indicating the bug# using the bugtraq property.
This works pretty well Except when I have more than one or two changes. If I created 10 branches for ten work requests I want to know how to easily tell which ones are already merged into trunk, and which ones aren't. If I'm supposed to use the mergeinfo property that seems crazy...
I'm not wanting to switch from subversion, so don't suggest it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当分支重新集成到主干中时,为什么不删除它呢?当功能分支重新集成时,您应该做什么(在一般情况下)。因此诊断很简单:如果分支存在,则它尚未重新集成。
Why don't you just delete the branch when it has been reintegrated into the trunk? That what you're supposed to do (in the general case) when a feature branch has been reintegrated. So the diagnostic is simple : if the branch exists, it hasn't been reintegrated.
你的工作流程对我来说似乎很不错。但是,合并回主干后,您不再需要该 bug 分支,因此将其删除。这样,您将只拥有作为打开的错误的分支数量。
如果需要的话,你可以随时取回分支,但它不会把事情弄乱。
Your workflow seems pretty good to me. However, after you merge back to trunk, you no longer need the bug branch, so delete it. That way, you will only ever have the number of branches as opened bugs.
You can always get the branch back if you need to, but it won't clutter things up.
从我的角度来看,为每个错误创建一个分支并不是一个好的做法。正如分支最佳实践提到的,您应该在两种情况下创建分支:
看来你只需要第二个分支。为了更清楚地看一下下面的图片:
开发分支是保留在你的 trunk 目录(绿线)。您可以创建一个名为发布分支(红线)的分支,并将要发布的更改合并到其中。这样,只有选定的更改才会进入您的发布版本。如果您正在开发一项新功能,可能需要 1-2 周以上的时间,请创建一个功能分支(蓝线),并在完成后合并回更改。功能分支完成后可能会被删除。
因此,我建议您只有一个分支,称为发布分支。当您收到错误时,请对您的开发线进行更改。当测试正常后,您可以将更改合并回发布行。这样,您就可以只发布您想要的功能。此外,通过查看您的发布线历史记录,您可以找到哪些更改已合并到您的发布线中。
Creating a branch for each bug is not a good practice from my point of view. As branching best practices mentions, you should create branches in two cases:
It seems that you just need the second branch. To make it clearer take a look at the picture below:
The development branch is the one that is kept under your trunk directory (the green line). You can create a branch called the release branch (the red line) and merge the changes you want to release into it. This way, only the selected changes come into your released version. If you are developing a new feature that may take you more than 1-2 weeks, create a feature branch (the blue line) and merge back the changes when you finish. The feature branches may be deleted when they are done.
So, I propose you to have just one branch called the release branch. When you receive a bug, make the changes in your development line. When the testing is OK, you can merge the changes back to the release line. This way, you can release just those features that you want. In addition, by taking a look at your release line history, you can find which changes has been merged into your release line.