如何自动合并2个头像 [英] How to auto-merge 2 heads with mercurial

查看:158
本文介绍了如何自动合并2个头像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们刚刚从颠覆转变为水银,有一件事比预期花费了更多时间.合并头.

We just changed over to mercurial from subversion and there is one thing that is taking up more time than expected; merging heads.

我们喜欢这样一个事实,它保持独立于2个提交的合并(与颠覆相比),但是我们最终会定期合并2个heads以进行不相关的更改.

We love the fact that it keeps merges independent from the 2 commits (compared to subversion) but we end up on a regular basis merging 2 heads for unrelated changes.

简单的场景. 我和鲍勃都是最新的. 我们俩都在默认(又名main)分支上拥有最新的仓库,并在不同文件中进行了改进.

Simple scenario. Both me and Bob are up to date. We both have ou repo up to date on default (aka main) branch and do improvement in different files.

我们提交,只有一个将能够推送到中央服务器,另一个将创建2个头部.然后,拉动,选择2个磁头,合并(由于更改位于不同的文件上,因此轻松进行).提交,然后推送.

We commit and only one will be able to push to the central server, the other one will create 2 heads. Then, pull, select 2 heads, merge (it will go easily since changes are on different files). Commit, then push.

因此,有一个扩展程序可以执行以下步骤 尝试合并 如果没有冲突 犯罪 别的 取消合并

Therefore, is there an extension that does these steps Attempt merge If no conflicts Commit else Cancel merge

我们希望在自动服务器上运行此代码,因此对其进行+1,这是命令行,如果可以在不触摸工作副本的情况下进行合并,则对其进行+1.

We are looking to have this run on an automated server, so +1 it this is command line and another +1 if it can do the merge without touching the working copy.

谢谢!

更新:
我们最终做了一些python脚本来管理最常见的任务(合并和构建;合并2个头).

Update:
We ended up doing a few python scripts to manage the most common tasks (merge up & build; merge 2 heads).

感谢您的帮助!

推荐答案

听起来您应该可以使用hg fetch.它将从服务器中提取更改,合并,然后自动提交合并.它也提示合并冲突.它包含在Mercurial中,因此只需添加

It sounds like you should be able to use hg fetch for this. It'll pull the changes from the server, merge, and then automatically commit the merge. It does prompt for merge conflicts as well. It's included with Mercurial, so just add

fetch =

您的hgrc,您应该已经准备就绪.它不会自动推送,但这通常是个坏主意.通常,您需要先运行测试并解决所有合并问题,然后再将代码发布给其他人.

to your hgrc, and you should be all set. It doesn't automatically push, but that's usually a bad idea anyway. You would typically want to run tests and resolve any merge problems before pushing your code out to everyone else.

这篇关于如何自动合并2个头像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆