Mercurial hg,我做得对吗?
我们正在从 CVS 转换为 Mercurial hg。
我们的基础设施是 Windows 2003/IIS6
- 每个开发人员在他们的计算机上进行开发
- 1x 开发服务器
- 1x 临时服务器
- 生产环境
这是我到目前为止所做的:
在我的计算机、开发服务器和临时服务器上安装了 Mercurial。
- 在开发人员上创建了一个存储库。服务器。
- 在那里导入了我们的 CVS 存储库。
- 将该存储库克隆到我的本地计算机。
- 将该存储库克隆到我们的临时服务器。
在过去的开发中,我们总是共享一个分支,这并不理想,但合并是如此痛苦,以至于我们从不打扰和处理它。
现在,如果我理解正确的话,我们应该这样做:
Local:
- hgbranch myfeature1 //Start work on feature1
需要紧急修复错误,使用影响与我们的功能相同的文件
- hg update default
- hgbranch bugfix1 //修复错误
- hg commit --rev bugfix1 //完成修复我们提交的错误
- hg push --rev bugfix1 -f //-f 这里看起来很奇怪,强制创建一个新分支
- hg update feature1 //我们返回到 feature1 上工作
- hg commit --rev feature1 //完成工作 commit
- hg push --rev feature1
DEV
- hg Branch //我们看到 bugfix 和 feature1
- hg merge --rev bugfix1
- hg commit //提交 bugfix1
- hg merge --rev feature1
- hg commit //提交 feature1 //Dev master 现在是我们的 main为新开发人员准备的主干包含功能 1 和错误修复 1。
分阶段(QA 需要在测试 feature1 之前签核该重要的错误修复
- hgcoming //我们看到新的东西
- hg pull --rev bugfix1
- hg merge --rev bugfix1
- hg commit
- //QA 测试和签核bugfix1 我们克隆到生产仓库并同步。
- //QA 现在可以测试 feature1,我们在 bugfix1
- hg pull --rev feature1
- hg merge --rev feature1
- hg commit //commiting merge feature1
- //QA 测试 feature1 并签核
- 我们克隆到生产存储库并同步,
这种方式是否有意义?
We are in the process of converting from CVS to Mercurial hg.
Our infrastructure is Windows 2003/IIS6
- Each developer develop on their machine
- 1xDevelopement server
- 1xStaging server
- Production environment
Here's what I have done so far:
Installed Mercurial on my machine, on the development server and on the staging server.
- Created a repository on the dev. server.
- Imported our CVS repository in there.
- Cloned that repository to my local machine.
- Cloned that repository to our staging server.
For development in the past we always shared 1 branch, not ideal but merging was such a pain that we never bothered and dealt with it.
Now if I understand correctly, we should be doing this:
Local:
- hg branch myfeature1 //Start work on feature1
Urgent bugfix required, using the affecting the SAME files as our feature
- hg update default
- hg branch bugfix1 //fix bug
- hg commit --rev bugfix1 //done fixing bug we commit
- hg push --rev bugfix1 -f //-f seems odd here, forcing to create a new branch
- hg update feature1 //we return to work on feature1
- hg commit --rev feature1 //done work commit
- hg push --rev feature1
DEV
- hg branches //we see the bugfix and feature1
- hg merge --rev bugfix1
- hg commit //commiting bugfix1
- hg merge --rev feature1
- hg commit //commiting feature1 //Dev master is now our main trunk ready for a new developer containing the feature1 and bugfix1.
Staging (The QA needs to signoff on that important bugfix before testing feature1
- hg incoming //we see the new stuff
- hg pull --rev bugfix1
- hg merge --rev bugfix1
- hg commit
- //QA test and signoff bugfix1 we clone to a production repo and sync.
- //QA can now test feature1 which we finished some days after bugfix1
- hg pull --rev feature1
- hg merge --rev feature1
- hg commit //commiting merge feature1
- //QA test feature1 and signoff
- We clone to a production repo and sync.
Does this way make sense? Am I complicating things and will it bite me in the ass later?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您已经很好地掌握了概念,但是其中有一些奇怪的地方和一些问题,我将在下面列出它们:
hgparents
返回的任何内容,这始终是您上次hg update
编辑到的内容。hg Push --rev bugfix1 -f
不需要-f
。从历史上看,警告“您正在创建一个新头”通常意味着您忘记合并,但现在如果新头是一个新的命名分支,则警告将被抑制。请记住,合并也是编码 - 进行合并的人正在选择应该做什么不应该是这样。质量检查人员可能有能力做到这一点,但这是开发人员的工作。另外,为什么要进行两次?通常的交接类似于“QA,拉出修订版 897a9d9f9a7 并请测试 - 开发人员”。如果你想变得更奇特,你可以有一个像“readyforQA”这样的标签,开发人员可以沿着“默认”分支移动(在这个例子中,他们在步骤 3 和 5 之后使用
hg tag
让 QA 知道有新的东西需要拉动,我给你的一条建议是不要试图过度设计 DVCS 导致一种随意的工作方式,一开始这有点可怕。 ,但你往往会发现子团队和成对的人有你从未知道的克隆,最后只要你有一些严格的规则,比如“没有首先通过质量保证,任何东西都不会进入生产”。休息一下就可以了。
It looks like you've got the concepts down great, but you've got some oddities and some questions in there, I'll hit them as a list below:
hg parents
returns, which is always whatever you lasthg update
ed to.hg push --rev bugfix1 -f
won't require a-f
in very new (1.5+) versions of mercurial. Historically the warning "you're creating a new head" usually meant you forgot to merge, but now if the new head is a new named branch the warning is suppressed.Remember, merging is coding too -- the person doing the merge is making choices about what should and shouldn't be. The QA people might be capable of it, but it's the developer's job. Also, why do it twice? The usual handoff for this is something like "QA, pull revision 897a9d9f9a7 and test please -- the developers". If you want to get fancy you can have a tag like 'readyforQA' that the developers move along the 'default' branch as they go (in this example they'd
hg tag
after their steps 3 and 5 and let QA know there's new stuff to pull.The one piece of advice I'd give you is don't try to over-engineer the process. DVCSs lead to a sort-of haphazard way of working, that's a little scary at first, but tends to work out. YOu'll find sub-teams and pairs of folks have clones you never knew about and in the end so long as you have a few firm rules like "nothing goes to production without first passing through QA" the rest sort of works itself out.