P3D3::Show diffs for only merged files

Issue #191 open
created an issue

It would be a cool thing if machg can automerge files and only show the diff window for user-interaction when the changes are not clear.

Right now the user must check each file individually and manually after merging and before merge commit. TortoiseHG solved that issue a little nicer.

thanks in advance T.H.

Comments (4)

  1. Jason Harris repo owner

    Short answer: So when you do a merge you want to remember only the files which had a conflict that you resolved and mark only those files... Interesting question. You are the second person to ask about this. (https://bitbucket.org/jfh/machg/issue/191)

    Currently there is no "easy" way to do this, accept you remembering.

    The non-easy way would be for you to set up your own shell script tool which would in turn call the merge tool. Eg if you are using filemerge (opendiff) as your merge tool in the MacHg preferences you would select 'Other...' as your merge tool with say the tool 'mytool' then you would have to create the shell script 'mytool' (it has to be on your path) and then have this shell script record what files it is being called with and then in turn call 'opendiff'. All a bit complicated.

    The other solution is to modify core mercurial so it records the list of files for which it called the merge tool... I am not sure that the core Mercurial people would want such a change. But its something for me to think about...

    To change this you would change the function def filemerge(repo, mynode, orig, fcd, fco, fca): in mercurial/filemerge.py

    so that if the premerge wasn't successful then the name of the local file (fcd) would be appended to a file say

    cachefile = repo.opener('cache/mergedfiles', 'w', atomictemp=True) cachefile.write('%s\n' % (fcd))

    Then when we start a merge via def merge(ui, repo, node=None, opts): in commands.py one would need to delete the 'cache/mergedfiles' file.

    Then in MacHg we would need to look at this file when we are in the merged state and display an icon overlay accordingly... Or highlight the merged file differently...

    It would make a nice addition! Patches are very welcome for this!

    Cheers, Jas

  2. Log in to comment