CodeMerge 2 way and left over files

Discussion of open issues, suggestions and bugs regarding file and folder merge tool – Code Compare
Post Reply
darren
Posts: 3
Joined: Thu 04 Aug 2011 14:18

CodeMerge 2 way and left over files

Post by darren » Thu 04 Aug 2011 14:33

Using TortoiseHG and CodeCompare (free version) so I had to mess with the example settings for Mercurial as they where for a 3 way merge.

So I have my merge settings as ....

Code: Select all

[merge-tools]
codemerge.executable=C:\Program Files\Devart\CodeCompare\CodeMerge.exe 
codemerge.args=/SC=Hg /environment=standalone  /TWOWAY /TF=$other /MF=$local /RF=$output /TT="Theirs" /MT="Mine" /RT="Merged" 
codemerge.gui=True 
codemerge.checkconflicts=True
This works so that I get a two way merge of 'Theirs' and 'Merged' that TortoiseHg accepts the merged file from. The only issue I have is that it leaves the mine file (for example sample.cs.orig) in the project folder afterwards. I have to manually delete the files or it keeps appearing in tortoisehg to add it to the repo.

Is there a way to remove the file after the merge?

THANKS

Artem
Devart Team
Posts: 137
Joined: Mon 21 Jun 2010 14:02

Post by Artem » Mon 08 Aug 2011 13:17

You can specify /removefiles in command line arguments. In that case $other and $local files will be removed after $output file is changed and merge is closed.

darren
Posts: 3
Joined: Thu 04 Aug 2011 14:18

Post by darren » Wed 17 Aug 2011 12:45

I've tried that and gone through resolving a conflict in tortoisehg. After doing merge I am prompted by CodeMerge to select the file and I select the 'Result' one (which appears to Program.cs.resolve in the project directory) but when going back to tortoisehg it states the file has not been resolved and will not move on.

Artem
Devart Team
Posts: 137
Joined: Mon 21 Jun 2010 14:02

Post by Artem » Thu 18 Aug 2011 11:07

Having installed the latest version of TortoiseHg we discovered that it shows an error when merge tool deletes an .orig file. Perhaps this problem should be reported to their support. The possible workaround is using the “hg purge” command or simply creating a batch to delete all .orig files. You can also add .orig to the ignore filter, maybe even making it global by specifying a path to .hgignore file in the global settings file. For example:

Code: Select all

[ui]
ignore = %userprofile%\.hgignore
Also, you can try writing an update-hook to delete .orig files automatically – see details in Mercurial documentation.

darren
Posts: 3
Joined: Thu 04 Aug 2011 14:18

Post by darren » Thu 18 Aug 2011 12:17

Just tried the settings from you integration page and even in 2 or 3 way mode it still complains the 'original' file is missing. Does appear to be THg requiring all files after the merge :(

Would probably have to use the hook idea as the batch file can't delete the file as it would run during merge, not after.

I'll raise it with the THg developers to see what they say. Thanks for your help!

Post Reply