[issue2965] Merge tool which handles binary not invoked if premerge fails on binary files

Aaron Jensen bugs at mercurial.selenic.com
Thu Aug 18 20:13:30 CDT 2011


New submission from Aaron Jensen <ajensen at webmd.net>:

We a bunch of UTF-16-encoded XML files in our repository.  Under UTF-16, 
each character is encoded using two bytes.  Since most characters don't need 
two bytes, most characters begin with NULL.  Mercurial sees these files as 
binary.

I use Beyond Compare to merge.  Beyond Compare will handle UTF-16 files.  I 
also have the premerge option set to True.  Unfortunately, the premerge 
always fails when merging binary files.  Because of this failure, Mercurial 
never asks Beyond Compare to merge my file.  I would expect setting binary = 
True would still run my merge tool even if the pre-merge fails.

What I'd really like is Mercurial to be a little bit smarter about handling 
text files that are UTF-16 encoded, or any other encoding that might include 
NULL bytes.

# Steps to Reproduce

#. Update your Mercurial configuration file with a merge tool that supports 
UTF-16.  I use Beyond Compare.  This is my configuration:
  [merge-tools]
  bcomp.executable = C:\Program Files\Beyond Compare 3\BCompare.exe
  bcomp.args = $local $other $base $output
  bcomp.priority = 1
  bcomp.premerge = True
  bcomp.gui = True
  bcomp.binary = True

  [ui]
  merge = bcomp

#. Create a file Mercurial thinks is binary, but is actually text, like a 
UTF-16 encoded file (I've attached one you can use).
#. Create a repository.  Add the UTF-16 encoded file.
#. Create a branch.  Modify the file on the branch.
#. Merge the branch into default.
#. Note that Mercurial never launches the merge tool.

----------
files: UTF16.xml
messages: 17184
nosy: splatteredbits
priority: bug
status: unread
title: Merge tool which handles binary not invoked if premerge fails on binary files

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2965>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UTF16.xml
Type: text/xml
Size: 116 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110819/ae821601/attachment.xml>


More information about the Mercurial-devel mailing list