Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

status: split hunks on line feeds only

splitlines could split on carriage returns, generating invalid diff
hunks.

Changeset 46f94acbaedd

Parent 3cad77a708ba

by Steve Borho

Changes to one file · Browse files at 46f94acbaedd Showing diff from parent 3cad77a708ba Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​status.py Stacked
 
40
41
42
43
 
44
45
46
47
 
48
49
50
 
60
61
62
63
 
64
65
66
67
 
68
69
70
 
40
41
42
 
43
44
 
 
 
45
46
47
48
 
58
59
60
 
61
62
 
 
 
63
64
65
66
@@ -40,11 +40,9 @@
 def hunk_markup(text):   'Format a diff hunk for display in a TreeView row with markup'   hunk = "" - lines = text.splitlines() + lines = text.split('\n')   for line in lines: - line = gobject.markup_escape_text(hglib.toutf(line[:512])) - if line[-1] != '\n': - line += '\n' + line = gobject.markup_escape_text(hglib.toutf(line[:512])) + '\n'   if line.startswith('---') or line.startswith('+++'):   hunk += '<span foreground="#000090">%s</span>' % line   elif line.startswith('-'): @@ -60,11 +58,9 @@
 def hunk_unmarkup(text):   'Format a diff hunk for display in a TreeView row without markup'   hunk = "" - lines = text.splitlines() + lines = text.split('\n')   for line in lines: - line = gobject.markup_escape_text(hglib.toutf(line[:512])) - if line[-1] != '\n': - line += '\n' + line = gobject.markup_escape_text(hglib.toutf(line[:512])) + '\n'   hunk += line   return hunk