# HG changeset patch # User Mads Kiilerich # Date 1506982480 -7200 # Node ID 0c19e4661b71aab2cdc19a19f9c6842c63f52d2c # Parent 54199f3aab93a2f42a9c1a04dc3341f83213c07c diffs: inline / remove _clean_line diff -r 54199f3aab93 -r 0c19e4661b71 kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py Tue Oct 03 00:14:40 2017 +0200 +++ b/kallithea/lib/diffs.py Tue Oct 03 00:14:40 2017 +0200 @@ -310,12 +310,6 @@ difflines = imap(self._escaper, re.findall(r'.*\n|.+$', rest)) # don't split on \r as str.splitlines do return meta_info, difflines - def _clean_line(self, line, command): - """Given a diff line, strip the leading character if it is a plus/minus/context line.""" - if command in ['+', '-', ' ']: - line = line[1:] - return line - def _parse_gitdiff(self, inline_diff=True): """Parse self._diff and return a list of dicts with meta info and chunks for each file. If diff is truncated, wrap it in LimitedDiffContainer. @@ -535,7 +529,7 @@ 'old_lineno': affects_old and old_line or '', 'new_lineno': affects_new and new_line or '', 'action': action, - 'line': self._clean_line(line, command) + 'line': line[1:], }) line = diff.next() @@ -547,7 +541,7 @@ 'old_lineno': '...', 'new_lineno': '...', 'action': 'context', - 'line': self._clean_line(line, command) + 'line': line, }) line = diff.next() if old_line > old_end: