1

We are using Mercurial as an SCM to handle the source script files of a program. Each project we manage has ~5000 files with each file containing a section with some product-specific informations about the file itself (version list, date, time etc.). This section is - due to the way it is structured - in 80% of the merges, the only section that has conflicts. They are easily resolved, but when merging around 300 files, it gets tiresome.

The problem is: I have no control over the way this section is written and I cannot change the format of the section itself, as it would make the file unusable by the program.

My question: is there a way in mercurial (hooks?), that allows me to

  1. pre-process the file with a script
  2. let mercurial do the merge
  3. if merged correctly: post-process the file with a script. otherwise: "resolve-conflicts" as usual.
4

1 回答 1

1

您可能可以通过创建自定义合并工具来摆脱它:

https://www.mercurial-scm.org/wiki/MergeToolConfiguration

在删除不断变化的部分后调用“diff”的简单脚本可能就足够了。

听起来这些部分是(不推荐的)关键字扩展旨在处理的废话,但我认为您在它们周围没有很大的灵活性。

于 2013-11-06T02:17:15.753 回答