patman: fix end of changes detection
authorIlya Yanok <ilya.yanok@cogentembedded.com>
Mon, 6 Aug 2012 23:46:05 +0000 (23:46 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 2 Sep 2012 14:22:49 +0000 (16:22 +0200)
Changes may end in '---' line or Signoff line (generated by
git format-patch) in case of Series-changes: lines being
the last ones in commit message. So detect it properly.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
tools/patman/patchstream.py

index be40af3ed2908fb964a1b0b83a8e56f8faf71886..036b1290f965471d451fe18ee5710d4bbe26101d 100644 (file)
@@ -36,6 +36,9 @@ re_remove = re.compile('^BUG=|^TEST=|^Change-Id:|^Review URL:'
 # Lines which are allowed after a TEST= line
 re_allowed_after_test = re.compile('^Signed-off-by:')
 
+# Signoffs
+re_signoff = re.compile('^Signed-off-by:')
+
 # The start of the cover letter
 re_cover = re.compile('^Cover-letter:')
 
@@ -207,6 +210,9 @@ class PatchStream:
             if is_blank:
                 # Blank line ends this change list
                 self.in_change = 0
+            elif line == '---' or re_signoff.match(line):
+                self.in_change = 0
+                out = self.ProcessLine(line)
             else:
                 self.series.AddChange(self.in_change, self.commit, line)
             self.skip_blank = False