Lines Matching full:line
20 # Lines which are allowed after a TEST= line
49 STATE_PATCH_SUBJECT = 1 # In patch subject (first line of log for a commit)
51 STATE_DIFFS = 3 # In the diff part (past --- line)
62 self.skip_blank = False # True to skip a single blank line
63 self.found_test = False # Found a TEST= line
66 self.linenum = 1 # Output line number we are up to
75 self.signoff = [] # Contents of signoff line
78 def AddToSeries(self, line, name, value): argument
85 line: Source line containing tag (useful for debug/error messages)
93 self.series.AddTag(self.commit, line, name, value)
95 def AddToCommit(self, line, name, value): argument
101 line: Source line containing tag (useful for debug/error messages)
123 def ProcessLine(self, line): argument
124 """Process a single line of a patch file or commit log
126 This process a line and returns a list of lines to output. The list
142 line: text line to process
147 # Initially we have no output. Prepare the input line string
149 line = line.rstrip('\n')
151 commit_match = re_commit.match(line) if self.is_log else None
154 if line[:4] == ' ':
155 line = line[4:]
158 series_tag_match = re_series_tag.match(line)
159 commit_tag_match = re_commit_tag.match(line)
160 cover_match = re_cover.match(line)
161 cover_cc_match = re_cover_cc.match(line)
162 signoff_match = re_signoff.match(line)
165 tag_match = re_tag.match(line)
166 is_blank = not line.strip()
173 # It has its own line with a Subject: tag
200 # but we are already in a change list, that means a blank line
203 self.warn.append("Missing 'blank line' in section 'Series-changes'")
208 if line == 'END':
223 self.section.append(line)
227 self.commit.subject = line
230 elif re_remove.match(line) and not commit_tag_match:
235 if line.startswith('TEST='):
247 self.AddToSeries(line, 'cover-cc', value)
252 # Blank line ends this change list
254 elif line == '---':
256 out = self.ProcessLine(line)
259 self.series.AddChange(self.in_change, self.commit, line)
272 (self.commit.hash, line))
275 self.AddToSeries(line, name, value)
283 self.AddToCommit(line, name, value)
296 self.warn.append("Ignoring %s" % line)
300 out = [line]
306 out = [line]
308 # Well that means this is an ordinary line
311 m = re_space_before_tab.match(line)
313 self.warn.append('Line %d/%d has space before tab' %
316 # OK, we have a valid non-blank line
317 out = [line]
325 elif line == '---':
331 out += [line]
336 if not re_allowed_after_test.match(line):
362 line = infd.readline()
363 if not line:
365 out = self.ProcessLine(line)
368 for line in out:
369 match = re_fname.match(line)
373 if line == '+':
376 if self.blank_count and (line == '-- ' or match):
377 self.warn.append("Found possible blank line(s) at "
380 outfd.write(line + '\n')
409 for line in stdout.splitlines():
410 ps.ProcessLine(line)
434 for line in text.splitlines():
435 ps.ProcessLine(line)
508 for line in lines:
509 if line.startswith('Subject:'):
513 line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
516 elif line.startswith('*** BLURB HERE ***'):
518 line = '\n'.join(text[1:]) + '\n'
520 line += '\n'.join(series.notes) + '\n'
524 line += '\n' + '\n'.join(out)
525 fd.write(line)