w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to force a tool resolve with a tortoisehg merge

I hope I don't come across as making light of your question but I'm still having difficulty seeing a practical application of it.

Anyway! I'm not sure of the best way to do this with TortoiseHg or command line mercurial (or if it's even possible), but with a diff tool and a bit of wrangling, I managed something that might meet your needs. If this is useful, it would be easy to automate some of the wrangling :)

I typically use BeyondCompare, but it doesn't support 3-way folder compare (although see this post). So for this I used KDiff (that comes with TortoiseHg).

  1. First, right click on each head and export > archive > Directory of files (pick whatever target folders you like).
  2. Next, do the same on the common ancestor (easily done by selecting both changesets, right clicking and choosing "Goto common ancestor").
  3. Now open KDiff3 and choose the three folders created above. KDiff's output should very intuitively show all files that are different in either branch.
  4. Checking the "Merge" box (and providing a fourth destination directory) while performing the previous step will allow you to manually merge everything as you please.
  5. Getting the result of the merge back into a new mercurial changeset, although cumbersome, should be conceptually straightforward.

Sample output from

I hope this suits your purposes. Let me know if you have need of clarification!

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.