开发者

Merge xls with TortoiseHg

开发者 https://www.devze.com 2023-02-25 09:03 出处:网络
I want to merge two MS Excel .xls files while updating the repository with TortoiseHg, and I get the following error:

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).


  1. In Explorer, right-click on the repository and clone it to a temporary clone folder.
  2. 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.
  3. Open both versions of the spreadsheet in Excel, and manually copy the changes over into the main repository.
  4. Mark the file resolved in the main repository.
  5. Commit the merge.
  6. Delete the temporary clone.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号