@@ -384,7 +384,7 @@ class ApplyStablePatches(StdApp):
cc = 1
ccstable = compile(r'^\s*Cc:.*\b(stable)\b.*', IGNORECASE | MULTILINE)
cchint = compile(r'((?P<for>\b(for)\b)|(?P<gr>\s*>\s*)|(?P<ge>\s*>=\s*)|(\s*))(?P<v>[v]*)(?P<kver>[0-9]\.[0-9][^\s+,\]]*)(?P<plus>[+]*)[,\]]*((?P<only>[\s]+only)|(?P<later>[\s]+and later)|(\s*))')
- stable = compile(r'^\s*Stable:.*', IGNORECASE | MULTILINE)
+ stable = compile(r'^\s*Stable:.*\s+\b(apply|do-not-apply)\b.*', IGNORECASE | MULTILINE)
fixes = compile(r'^\s*Fixes:.*\s+([a-f0-9]{6,}).*', IGNORECASE | MULTILINE)
forstable = []
fixeslist = []
@@ -396,8 +396,9 @@ class ApplyStablePatches(StdApp):
eout(body)
continue
- # a "Stable:" line (e.g. which may have been added via git
- # notes) overrides a "Cc: stable@" line
+ # a "Stable: apply" or "Stable: do-not-apply" line (e.g. which
+ # may have been added via git notes, and may also include a
+ # cchint version hint) overrides a "Cc: stable@" line.
s = stable.search(body)
if not s:
s = ccstable.search(body)
To help preclude accidental regex matches, 'Stable:' pseudo-header lines (which we add to mainline commits via git notes) must include an additional keyword, either "apply" or "do-not-apply", e.g.: Stable: apply Stable: apply # optional version hint as for Cc: stable lines Stable: do-not-apply # optional comments Signed-off-by: Kamal Mostafa <kamal@canonical.com> --- stable/apply-stable-patches | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)