如何获取有关冲突文件的基本修订以及修改后的版本? [英] How to get mercurial to emit base revision of conflicted file as well as modified version?

查看:65
本文介绍了如何获取有关冲突文件的基本修订以及修改后的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Mercury将两个分支合并在一起,并且存在一些冲突.在Subversion中工作时,合并冲突将导致冲突的文件被统一的diff替换,我自己的文件版本带有".mine"扩展名,以及文件的最后签入版本带有".rxxx" 已添加扩展名.

I'm trying to merge two branches together using mercurial and there are some conflicts. When working in Subversion, merge conflicts would result in the conflicted file being replaced by a unified diff, my own version of the file with the ".mine" extension added as well as the last checked in version of the file with the ".rxxx" extension added.

使用Mercurial,我只会得到统一的差异以及添加了".orig"扩展名的自己的版本.

With mercurial, I only get the unified diff as well as my own version with the ".orig" extension added.

我习惯于自己在Eclipse中使用比较>彼此"命令或FileMerge在自己的时间编辑合并,但是由于没有手动进行获取就无法使用基本修订,因此我无法再这样工作.

I'm used to editing the merges myself in my own time in eclipse using the "Compare With > Each Other" command or using FileMerge, however as the base revision is not available without manually going and fetching it I can't work this way any more.

我不想在hg merge命令期间执行合并-我宁愿自己做.

I do not want to perform the merging during the hg merge command - I prefer to do it in my own time.

是否可以使用设置或扩展名使之成为可能?

Is there a setting or extension I can use to make this possible?

推荐答案

如何设置一个合并工具来保存要运行的合并文件,以供该合并工具使用?

How about setting a merge tool that just saves the files mercurial is creating for the merge tool to operate on?

[ui]
merge = copy

[merge-tools]
copy.executable = /path/to/mycopy.sh
copy.args = $base $local $other $output

然后在mycopy.sh中执行以下操作:

And then in mycopy.sh just do something like:

#!/bin/sh
cp $1 $4.base
cp $2 $4.mine
cp $3 $4.theirs

这应该总是立即成功,并且为每个冲突的文件留一个.base.mine.theirs.您可以在~/.hgrc中设置一次,然后完成它.

That should always succeed instantly and leave you with a .base a .mine and a .theirs for each file that conflicted. You can set that up once in your ~/.hgrc and be done with it.

这篇关于如何获取有关冲突文件的基本修订以及修改后的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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