[Concept,31/32] patman: Update series description on scan

Message ID 20260226200106.1727176-32-sjg@u-boot.org
State New
Headers
Series patman: Add multi-upstream support |

Commit Message

Simon Glass Feb. 26, 2026, 8 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

When scanning a branch, check if the cover letter title has changed
and update the series description in the database. This keeps the
description in sync when the cover letter is edited between scans.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/patman/cseries.py | 7 +++++++
 1 file changed, 7 insertions(+)
  

Patch

diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py
index 0b4ce91b024..716d3c7aa88 100644
--- a/tools/patman/cseries.py
+++ b/tools/patman/cseries.py
@@ -932,6 +932,13 @@  class Cseries(cser_helper.CseriesHelper):
 
         self.db.pcommit_delete(svid)
         self._add_series_commits(ser, svid)
+
+        # Update series description if the cover letter has changed
+        branch_desc = ser.cover[0] if ser.cover else None  # pylint: disable=E1136
+        if branch_desc and branch_desc != ser.desc:
+            self.db.series_set_desc(ser.idnum, branch_desc)
+            tout.notice(f"Updated description to '{branch_desc}'")
+
         if not dry_run:
             self.commit()
             seq = len(ser.commits)