patman: Convert 'Series-xxx' tag errors into warnings
If the Series-xxx tag is not recognised patman currently reports a fatal error. This is inconvenient if a new feature is later added to patman that an earlier version does not support. Report a warning instead, to allow the user to take action if needed, but still allow operation to proceed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									313ef5f897
								
							
						
					
					
						commit
						dffa42c3ef
					
				|  | @ -114,7 +114,9 @@ class PatchStream: | ||||||
|             self.in_section = name |             self.in_section = name | ||||||
|             self.skip_blank = False |             self.skip_blank = False | ||||||
|         if self.is_log: |         if self.is_log: | ||||||
|             self.series.AddTag(self.commit, line, name, value) |             warn = self.series.AddTag(self.commit, line, name, value) | ||||||
|  |             if warn: | ||||||
|  |                 self.commit.warn.append(warn) | ||||||
| 
 | 
 | ||||||
|     def _add_to_commit(self, name): |     def _add_to_commit(self, name): | ||||||
|         """Add a new Commit-xxx tag. |         """Add a new Commit-xxx tag. | ||||||
|  |  | ||||||
|  | @ -59,6 +59,9 @@ class Series(dict): | ||||||
|             line: Source line containing tag (useful for debug/error messages) |             line: Source line containing tag (useful for debug/error messages) | ||||||
|             name: Tag name (part after 'Series-') |             name: Tag name (part after 'Series-') | ||||||
|             value: Tag value (part after 'Series-xxx: ') |             value: Tag value (part after 'Series-xxx: ') | ||||||
|  | 
 | ||||||
|  |         Returns: | ||||||
|  |             String warning if something went wrong, else None | ||||||
|         """ |         """ | ||||||
|         # If we already have it, then add to our list |         # If we already have it, then add to our list | ||||||
|         name = name.replace('-', '_') |         name = name.replace('-', '_') | ||||||
|  | @ -78,9 +81,10 @@ class Series(dict): | ||||||
|             else: |             else: | ||||||
|                 self[name] = value |                 self[name] = value | ||||||
|         else: |         else: | ||||||
|             raise ValueError("In %s: line '%s': Unknown 'Series-%s': valid " |             return ("In %s: line '%s': Unknown 'Series-%s': valid " | ||||||
|                         "options are %s" % (commit.hash, line, name, |                         "options are %s" % (commit.hash, line, name, | ||||||
|                             ', '.join(valid_series))) |                             ', '.join(valid_series))) | ||||||
|  |         return None | ||||||
| 
 | 
 | ||||||
|     def AddCommit(self, commit): |     def AddCommit(self, commit): | ||||||
|         """Add a commit into our list of commits |         """Add a commit into our list of commits | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue