1

I am on a Mac (Yosemite 10.10.5) and have been using git since forever. I am now working on a legacy project that is stored in Mercurial (hg) and although it kinda sorta feels similar to git, there are some definite differences that I'm trying to understand/get used to.

Currently I'm trying to figure out how to merge locally. I cloned a project, did some work to it on default, and am now ready to push it to the remote repo. However, several other developers have also made conflicting changes to source files in that repo in the meantime. So I now need to merge (and manually resolve conflicts) before I push.

What "hg diff tools" are available for Macs? How do I configure hg to use them when hg merge detects conflict? Also, very importantly, can someone confirm that hg merge will always resolve non-conflicting differences for you?

smeeb
  • 27,777
  • 57
  • 250
  • 447
  • 1
    So, what's the question? Of course there's merge. And of course it works. And then there are different merge tools which also work, each doing different things in case of conflicts (and defining 'conflict' slightly differently). Depends on which you want. Read the wiki: https://www.mercurial-scm.org/wiki/MergeToolConfiguration Use what you want. This question as-is is definitely is 'too broad' as-is or 'opinion-based'. – planetmaker Nov 20 '15 at 11:33
  • Thanks @planetmaker (+1) - that is the link that is giving me confusion! Its only example is "`mymergetool.something = something`", but how do I know what the valid values for "`something`" are? For instance, I would image that defining "`mymergetool.something = mindblown`" would not then go ahead and use [Atom](https://atom.io) for resolving merge conflicts, etc. **The question here is: what are the valid values for "`something`"?** If the thoughtless response is "*Anything that can act as a merge tool for `hg` brah*", then my followup question is "*Well the what are valid `hg` merge tools?*" – smeeb Nov 20 '15 at 12:03
  • This is a valid, scoped configuration question. – smeeb Nov 20 '15 at 12:04
  • At least 50% is "google merge tools for me" ;) - you can basically use any you want – planetmaker Nov 20 '15 at 12:37

1 Answers1

1

The answer depends on what you want. You can probably configure most merge tools to work with mercurial. The internal tools are not that bad, but a 3rd-party one might be more what you like, thus you should choose the one you are most comfortable with.

The actual configuration depends on the tool; personally I'm very comfortable with kdiff3: https://www.mercurial-scm.org/wiki/KDiff3

But there's many others, often you find the required configuration when searching for the tool name and mercurial. Some random finds:

See also the list of merge-related pages on the mercurial wiki: https://www.mercurial-scm.org/wiki/KDiff3?action=fullsearch&context=180&value=merge&titlesearch=Titel - it contains configuration for many tools.

The general way on how to configure it is described in the merge tools section https://www.mercurial-scm.org/wiki/MergeToolConfiguration (also see hg help merge-tools.

Community
  • 1
  • 1
planetmaker
  • 5,884
  • 3
  • 28
  • 37