Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek filedata: properly handle the case where a bfile is added or modified

Changeset 0524579d8c04

Parent 59d8bd19b8fc

by David Golub

Changes to one file · Browse files at 0524579d8c04 Showing diff from parent 59d8bd19b8fc Diff from another changeset...

 
6
7
8
 
9
10
11
 
47
48
49
50
 
51
52
53
 
72
73
74
 
75
76
77
 
326
327
328
 
 
 
329
330
331
 
367
368
369
 
 
 
370
371
 
6
7
8
9
10
11
12
 
48
49
50
 
51
52
53
54
 
73
74
75
76
77
78
79
 
328
329
330
331
332
333
334
335
336
 
372
373
374
375
376
377
378
379
@@ -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)