lib/patch.py: add top header parsing support
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 7 May 2013 03:03:19 +0000 (20:03 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 8 May 2013 07:49:23 +0000 (09:49 +0200)
Add a top_header for cases where a patchset might have a
full header that we may want users to keep around.

Cc: techtonik@gmail.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
lib/patch.py

index 4604663a8477654163cd2d17a244c4ca6eb74550..615a3d69b8f16152da4a3c7d75dcc1720cd1dd4e 100644 (file)
@@ -201,6 +201,7 @@ class PatchSet(object):
 
     # list of Patch objects
     self.items = []
+    self.top_header = ""
 
     self.errors = 0    # fatal parsing errors
     self.warnings = 0  # non-critical warnings
@@ -303,6 +304,7 @@ class PatchSet(object):
       if headscan:
         while not fe.is_empty and not fe.line.startswith("--- "):
             header.append(fe.line)
+            self.top_header += fe.line
             fe.next()
         if fe.is_empty:
             if p == None: