2

I am trying to force a manual merge for certain files per this question but it isn't working. Certain pom files are being auto merged even though I believe I have configured my .hgrc correctly. Any ideas?

I tried fiddling with the merge tools priority. Originally we had merge = bc under [ui] - removed this but it didn't help.

My .hgrc:

[ui]
editor = notepad
username = Boo Hoo <boo.hoo@who.com>
ssh = plink

[extensions]
fetch =
hgext.extdiff =
mq =
hgext.graphlog = 

[extdiff]
cmd.kdiff3 =
cmd.examdiff = C:\Program Files (x86)\ExamDiff Pro\ExamDiff.exe
cmd.bc = C:\Program Files (x86)\Beyond Compare 3\BCompare.exe
opts.bc = /leftreadonly

[merge-tools]
bc.executable = C:\Program Files (x86)\Beyond Compare 3\BComp
bc.args = /leftreadonly /centerreadonly $local $other $base $output
bc.priority = 1
bc.premerge = True

manual.executable = C:\Program Files (x86)\Beyond Compare 3\BComp
manual.args = /leftreadonly /centerreadonly $local $other $base $output
manual.priority = 100
manual.premerge = False

[merge-patterns]
.hgtags = manual
pom.xml = manual
**\pom.xml = manual
Community
  • 1
  • 1
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429

1 Answers1

1

Considering the file name patterns, and the fact that merge-pattern are glob by default, rooted at the root directory (see hgrc merge-pattern), you could try:

**/pom.xml

(to use the shell-style path separator '/' instead of '\')

or try a regex pattern:

re:.*[/\\]pom.xml$
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Good suggestion, but didn't work sadly. The premerge still happens. – Marcus Leon Apr 18 '11 at 13:33
  • @marcus: try removing `merge-tools` `bc`, and leave only one (the `manual`), to see if the issue persists. – VonC Apr 18 '11 at 13:35
  • Yes, it is still doing the premerge. Weird. – Marcus Leon Apr 18 '11 at 13:41
  • I tried adding `merge = manual` under `[ui]` and then removing all the merge-patterns entries. But that didn't work either. Seems like premerge just doesn't work, or I'm doing something silly. Latter likely.. – Marcus Leon Apr 18 '11 at 13:59
  • @Marcus: at this stage, you may want to check if any of the `.hgrc` directives are taken into account. Is `.hgrc` actually read? – VonC Apr 18 '11 at 14:04
  • @Marcus: so the other test is to make a merge-tools actually work, first with `bc.premerge = True`, then with `False`. – VonC Apr 18 '11 at 17:42
  • @Marcus: for example, does `bc.executable` alone gets always executed when `bc.premerge = False`? – VonC Apr 18 '11 at 19:23
  • In our example, there are about 10 pom files that changed in the 'other' head. When we do `hg merge`, the bc.executable is executed for 3 of the pom files. The other 7 appear to 'fall victim' to the premerge and not bc.executable nor any other merge tools are executed for them. – Marcus Leon Apr 18 '11 at 19:47
  • @Marcus: so the 7 others are ones without any conflict, capable of being merged automatically, then? What is the version of Mercurial used during this merge? Is it the latest one? Would it be a more recent Mercurial release which would fix the `premerge` directive? (I just looked at http://mercurial.selenic.com/wiki/WhatsNew: nothing *directly* related to '`premerge`') – VonC Apr 18 '11 at 19:56
  • Correct, no conflicts on seven others. Our version of Mercurial is 1.4.3. I'm not sure if I can upgrade.. – Marcus Leon Apr 18 '11 at 19:58
  • @Marcus: still, it would be worth testing if that "7-file-automatically-merged" behavior is consistent across different Mercurial releases. Since 1.4.3 is kind of old. – VonC Apr 18 '11 at 19:59