Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding a file while merging in Mercurial

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

Is there a way, when I want to merge B with A, to exclude titi.cs from merging, and only merge toto.cs? If it's possible, how can I do that?

like image 674
MaT Avatar asked Sep 06 '25 15:09

MaT


1 Answers

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.

like image 158
Ry4an Brase Avatar answered Sep 10 '25 10:09

Ry4an Brase