Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc2, 0.4rc3, and 0.4rc4

hggtk/history: fix diff hilite error on multi-byte charsets

Changeset 611be9228485

Parent 05bdcfb888f5

by TK Soh

Changes to one file · Browse files at 611be9228485 Showing diff from parent 05bdcfb888f5 Diff from another changeset...

 
183
184
185
186
 
187
188
189
 
375
376
377
378
 
 
379
380
 
381
382
383
 
385
386
387
388
 
389
390
391
 
402
403
404
405
 
406
407
408
 
183
184
185
 
186
187
188
189
 
375
376
377
 
378
379
380
 
381
382
383
384
 
386
387
388
 
389
390
391
392
 
403
404
405
 
406
407
408
409
@@ -183,7 +183,7 @@
  offset = eob.get_offset()   fileoffs, tags, lines, statmax = self.prepare_diff(lines, offset, file)   for l in lines: - buf.insert(eob, toutf(l)) + buf.insert(eob, l)     # inserts the tags   for name, p0, p1 in tags: @@ -375,9 +375,10 @@
  tags.append( [name, offset, offset+length] )   stats = [0,0]   statmax = 0 - for i,l in enumerate(difflines): + for i,l1 in enumerate(difflines): + l = toutf(l1)   if l.startswith("diff"): - txt = DIFFHDR % fname + txt = toutf(DIFFHDR % fname)   addtag( "greybg", offset, len(txt) )   outlines.append(txt)   markname = "file%d" % idx @@ -385,7 +386,7 @@
  statmax = max( statmax, stats[0]+stats[1] )   stats = [0,0]   filespos.append(( markname, offset, stats )) - offset += len(txt) + offset += len(txt.decode('utf-8'))   continue   elif l.startswith("+++"):   continue @@ -402,7 +403,7 @@
  else:   tag = "black"   l = l+"\n" - length = len(l) + length = len(l.decode('utf-8'))   addtag( tag, offset, length )   outlines.append( l )   offset += length