Merge xls with TortoiseHg
I want to merge two MS Excel .xls files while updating the repository with TortoiseHg, and I get the following error:
tool tortoisemerge can't han开发者_Go百科dle binary
tool kdiff3 can't handle binary
tool tortoisemerge can't handle binary
tool docdiff can't handle binary
abort: response expected
When I add these lines to the hgrc file:
[merge-patterns]
**.xls = docdiff
I get another error:
merging test.xls
merging test.xls failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
What am I doing wrong? When I run docdiff from command line it runs successfully.
I've solved the problem. Looks like I've tried automatic merge instead of manual one. Automatic merge of binaries is not supported, but I've figured out how to launch docdiff from TortoiseHG interface.
So, the answer is: in order to merge .xls
files with TortoiseHg one has to use manual merge with docdiff. TortoiseHg doesn't launch docdiff during automatic merge.
The Hg tools can't merge binary files, only text based files (most source code files are text based). What you could do is try to save your XLS file as a CSV (comma separated) file. This is a normal text file (that you can open with notepad for example). The Hg tools should be able to merge this type of file.
If you'd like to know more on why XLS files can't be merged. Try opening an XLS file with Notepad, you see that it's a lot of gibberish, Hg can't understand this gibberish without knowing the XLS file specification (which it doesn't).
- In Explorer, right-click on the repository and clone it to a temporary clone folder.
- Because Excel doesn't support opening two workbook files with the same name, rename the one in the temporary clone, so that it can be opened in Excel.
- Open both versions of the spreadsheet in Excel, and manually copy the changes over into the main repository.
- Mark the file resolved in the main repository.
- Commit the merge.
- Delete the temporary clone.
精彩评论