Home | History | Annotate | Download | only in checkout

Lines Matching refs:line

51 def git_diff_to_svn_diff(line):
52 """Converts a git formatted diff line to a svn formatted line.
55 line: A string representing a line of the diff.
66 matched = match(pattern, line)
69 return line
77 first_diff_line: The first filename line of a diff file.
78 If this line is git formatted, we'll return a
96 If deleted_line_number is zero, it means this line is newly added.
97 If new_line_number is zero, it means this line is deleted.
105 return [line[1] for line in self.lines if not line[0]]
111 def add_new_line(self, line_number, line):
112 self.lines.append((0, line_number, line))
114 def add_deleted_line(self, line_number, line):
115 self.lines.append((line_number, 0, line))
117 def add_unchanged_line(self, deleted_line_number, new_line_number, line):
118 self.lines.append((deleted_line_number, new_line_number, line))
145 for line in diff_input:
146 line = line.rstrip("\n")
148 transform_line = get_diff_converter(line)
149 line = transform_line(line)
151 file_declaration = match(r"^Index: (?P<FilePath>.+)", line)
159 lines_changed = match(r"^@@ -(?P<OldStartLine>\d+)(,\d+)? \+(?P<NewStartLine>\d+)(,\d+)? @@", line)
162 _log.error('Unexpected line change without file path '
163 'declaration: %r' % line)
170 if line.startswith('+'):
171 current_file.add_new_line(new_diff_line, line[1:])
173 elif line.startswith('-'):
174 current_file.add_deleted_line(old_diff_line, line[1:])
176 elif line.startswith(' '):
177 current_file.add_unchanged_line(old_diff_line, new_diff_line, line[1:])
180 elif line == '\\ No newline at end of file':
185 'chunk: %r' % line)