解决冲突:如何接受“他们的"自动更改? [英] Resolving conflicts: how to accept "their" changes automatically?

查看:64
本文介绍了解决冲突:如何接受“他们的"自动更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用hg merge合并冲突的更改时,Mercurial会在文件中插入一组标记,以将其合并到我的工作副本中,如下所示:

When merging conflicting changes using hg merge, Mercurial inserts a set of markers into the files to be merged in my working copy like this:

<<<<<<< local
  version = 0.2
=======
  version = 0.1
>>>>>>> other

然后,我从hg resolve --all -l生成的列表中手动编辑所有标记为U的文件,然后告诉Mercurial我已通过hg resolve -m file1 file2 file3 ...

Then I manually edit all files marked as U from a list produced by hg resolve --all -l and then I tell mercurial I have resolved them by hg resolve -m file1 file2 file3 ...

在许多情况下,我希望在一些冲突的文件上接受我自己的更改或他们自己的更改.我正在考虑创建两个简单的sed/awk/任何名为accept-theirs.shaccept-my.sh的脚本,或者是否有任何适当"的方式来做到这一点?

In many situations I would like however accept either my-only or their-only changes on some conflicting files. I am thinking to create two simple sed/awk/whatever scripts named accept-theirs.sh and accept-my.sh or is there any "proper" way to do it?

推荐答案

使用

hg resolve -t internal:other --all

接受theirs

hg resolve -t internal:local --all

接受yours

这篇关于解决冲突:如何接受“他们的"自动更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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