[PATCH v6 3/8] parser: Add series parsing
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Thu Oct 27 19:51:41 AEDT 2016
On 16/10/16 23:50, Stephen Finucane wrote:
> It is now possible to parse and store series, so do just that.
> The parsing at the moment is based on both RFC822 headers and
> subject lines.
>
> Signed-off-by: Stephen Finucane <stephen at that.guru>
One minor issue below.
Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
> +def parse_version(subject, subject_prefixes):
> + """Extract patch version.
> +
> + Args:
> + subject: Main body of subject line
> + subject_prefixes: List of subject prefixes to extract version
> + from
> +
> + Returns:
> + version if found, else 1
> + """
> + regex = re.compile('^[vV](\d+)$')
> + m = _parse_prefixes(subject_prefixes, regex)
> + if m:
> + return int(m.group(1))
> +
> + m = re.search(r'\([vV](\d+)\)', subject)
A commit like "Input: drv260x - add TI drv260x haptics driver" will be
picked up as v260 by this... I am struggling to think of a scenario
where this actually results in a SeriesRevision being created, but
nevertheless.
I assume based on the relevant test the idea is to pick up subjects like
"Terribly formatted patch (v3)"?
Perhaps match against "[vN]", "(vN)", " vN ", "vN ", " vN"?
I don't hugely care if this gets fixed or not.
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com IBM Australia Limited
More information about the Patchwork
mailing list