Changeset 0524579d8c04…
Parent 59d8bd19b8fc…
by
Changes to one file · Browse files at 0524579d8c04 Showing diff from parent 59d8bd19b8fc Diff from another changeset...
@@ -6,6 +6,7 @@ # GNU General Public License version 2, incorporated herein by reference.
import os
+import re
from mercurial import error, match, patch, util, mdiff
from mercurial import ui as uimod
@@ -47,7 +48,7 @@ return None
try:
data = fctx.data()
- if '\0' in data:
+ if '\0' in data or re.match(r'^\.kbf/', wfile):
self.error = p + _('File is binary.\n')
return None
except (EnvironmentError, util.Abort), e:
@@ -72,6 +73,7 @@ return 'C'
return None
+ isbfile = False
repo = ctx._repo
self.flabel += u'<b>%s</b>' % hglib.tounicode(wfile)
@@ -326,6 +328,9 @@ return
if status in ('M', 'A'):
+ if '.kbf/' + wfile in ctx:
+ wfile = '.kbf/' + wfile
+ isbfile = True
res = self.checkMaxDiff(ctx, wfile, maxdiff)
if res is None:
return
@@ -367,5 +372,8 @@ revs = [str(ctx), str(ctx2)]
diffopts = patch.diffopts(repo.ui, {})
diffopts.git = False
+ if isbfile:
+ olddata += '\0'
+ newdata += '\0'
self.diff = mdiff.unidiff(olddata, olddate, newdata, newdate,
oldname, wfile, revs, diffopts)
|
Loading...