Excluding a file while merging in Mercurial

后端 未结 2 1308
-上瘾入骨i
-上瘾入骨i 2021-01-03 10:46

I use Mercurial with TortoiseHg. I have two branches (A and B) with two files (toto.cs and titi.cs).

Is there a w

2条回答
  •  没有蜡笔的小新
    2021-01-03 11:38

    Sure. Not merging titi.cs is really just using titi.cs exactly as it exists in A or in B (your choice). You could do that manually like this:

    hg update A
    hg merge B
    hg revert --rev A titi.cs
    

    (swap A and B to go the other direction).
    Or you could do that automatically in your Merge Tool Confguration with something like this in your .hgrc.

    [merge-patterns]
    titi.cs = internal:local
    

    Which tells Mercurial to always use "this one not that one" for files matching that pattern.

提交回复
热议问题