5

Having read Completely manual Mercurial merge, I have such a .hgrc:

[ui]
merge = meld

[merge-tools]
meld.priority = 1
meld.premerge = False
meld.args = $local $other $base 

[merge-patterns]
** = meld

However, hg merge -r REV just works and I don't get what i'm missing...

I'd like to do a manual merge to drop some of the changes the other branch introduces. The other branch has a changeset affecting several files and I don't want to modify them all.

Community
  • 1
  • 1
Maxime R.
  • 9,621
  • 7
  • 53
  • 59

2 Answers2

6

I've got two guesses. Either your configuration settings aren't getting picked up or you don't have enough conflict for Mercurial to consider your merge in need of resolution.

You can check for the former with hg showconfig -- make sure you see your meld settings.

If they are showing up then maybe there isn't enough conflict between the two changesets you're merging. Even with premerge set to false there still needs to be something that requires merging. Are there actual changes in the same file in both changesets? Perhaps try hg merge --tool internal:fail and then check the hg resolve --list to see what's there.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
  • Ok, my meld settings are correctly picked up but it seems you're right about the fact there isn't enough conflict. The incoming changeset modify some unmodified files, I thought i would have been able to trigger a manual merge to drop some of these changes but it just appears to be impossible. – Maxime R. Apr 12 '12 at 09:46
  • Try `hg merge --tool internal:prompt` or `hg merge --tool internal:dump`. I don't know if they'll abort earlier in the process, but if they do then perhaps you can invoke meld manually? – Ry4an Brase Apr 12 '12 at 12:56
  • Thanks, actually I solved my issue by rebasing the incoming changeset on a much earlier revision of my project. That triggered some conflicts when merging, it launched meld and i got the opportunity to manually select which changes i wanted to keep :) – Maxime R. Apr 13 '12 at 00:18
  • Good deal. Even if meld doesn't launch you can always just fire up your editor and edit the source files to include/exclude whatever you want after merging but before committing. Adding new code during merge is usually frowned upon but manually going in and tossing out stuff is fairly normal. – Ry4an Brase Apr 13 '12 at 13:35
0

I' m following your instruction to use MELD when doing a diff. I get this:

    hg meld file.F
usage:
    meld                       Start with no windows open
    meld <dir>                 Start with VC browser in 'dir'
    meld <file>                Start with VC diff of 'file'
    meld <file> <file> [file]  Start with 2 or 3 way file comparison
    meld <dir>  <dir>  [dir]   Start with 2 or 3 way directory comparison

meld: error: no such option: -a

where does this -a option come from?

  • Hi, you should ask a new question for this. Seems like mercurial is not given a correct set of arguments. – Maxime R. Jul 13 '13 at 13:03