Search code examples
python-2.7mergeversion-controlmercurialtortoisehg

How to use merge tool "internal:fail" programmatically?


I am new in the Mercurial, and I am interested in the merging process. I would like to see how it happens programmatically, but something did not work out. I do not understand how to call the option, as we do it from the console using the hg merge --tool internal:fail command.

I did it like this

commands.merge(ui, repo, tool='internal:fail'),

but it still runs the default kdiff3.

I tried to do this

ui.setconfig('ui', 'merge', 'internal:fail') commands.merge(ui, repo),

but it works like the previous one.

If someone understands what I'm doing wrong and how to fix it, please answer me.

Thank you for your attention to my question, have a good time =)


Solution

  • I managed to find the answer to my question, if someone needs it, look

    We need to override the repository as follows:

    def reposetup (ui, repo):
        repo.ui.setconfig ('ui', 'merge', 'internal: fail') # or smth else, for example "merge3"
        repo.ui.setconfig ('ui', 'interactive', 'no')
    

    After this, the merge command will follow the configuration we defined =)