From patchwork Thu Feb 26 20:00:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1938 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136096; bh=uYdgAQspKzzZjzbm03TABGlg369t/9AePcqkS3bgQMQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=K89PX3w5IGYDD3IgSJYEqcDBbeFZgqk/r+gF0L1E1LIc77LfssTgB6oB/UlgXx+eO yaOjdFFcuY0mOdfgSujOsQfsGvJp5x1mHNMe4EAG/f6D7Dc4v6DlmL5c2q78FaZWMl v05NtXjQmOTo5ROKKKdFTdf80C+FFV29XjFn+4B5uoBmDhRx20KfVuJWQU28fjmk9K DtB8OsyFevlECVb1cOYJfUy2RS9SIv9pDZb42Xew5C6AKY4bnO+53SiU9K9krYOSbH xYdPAcibDYpIARJYQG7OcY4WWpUhomcDyVFUaxIDe/YohC80ugedpfvxVTaYY71ywe itIFKF4yev57A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 35BEC69E36 for ; Thu, 26 Feb 2026 13:01:36 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eySuUrwpQ9PF for ; Thu, 26 Feb 2026 13:01:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136096; bh=uYdgAQspKzzZjzbm03TABGlg369t/9AePcqkS3bgQMQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=K89PX3w5IGYDD3IgSJYEqcDBbeFZgqk/r+gF0L1E1LIc77LfssTgB6oB/UlgXx+eO yaOjdFFcuY0mOdfgSujOsQfsGvJp5x1mHNMe4EAG/f6D7Dc4v6DlmL5c2q78FaZWMl v05NtXjQmOTo5ROKKKdFTdf80C+FFV29XjFn+4B5uoBmDhRx20KfVuJWQU28fjmk9K DtB8OsyFevlECVb1cOYJfUy2RS9SIv9pDZb42Xew5C6AKY4bnO+53SiU9K9krYOSbH xYdPAcibDYpIARJYQG7OcY4WWpUhomcDyVFUaxIDe/YohC80ugedpfvxVTaYY71ywe itIFKF4yev57A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 231B569DAB for ; Thu, 26 Feb 2026 13:01:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136094; bh=7Xr60iw7cP0MSdZp/xIEUAcqBk6m4ZPTbkLAH3E044U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUnCHws2sPrwPZBwe6DSMwsmCNpLv2+iASaGdeq9heZwD9l9ptuL8puFEORHB6LlU ZRQ+6hBtKdODotTRQvHmFDthd2QUzLrKA2ABGB0hNNd6avah0ncKsEToCYrm2B0mc5 ZjtYr4iISJd+jMFMvuPgbTfdkTxg+QwJwy6Zemp3rrZWBLo8OLGk23FZrUzA54t44P u8jo7EOzu4llMgS6qsxyLzTSpG58pvnN4mFFmAq2ogAl2xqbPMNGdaVAL+DZ3xQbps R4WDhN5Of+IoyFlpMF8wo9itXXyxM8WQVDkOlNwC3NP96weaRdFHmc6LcPMtLXWJJP TrMY2dHqdhx6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0475269D4A; Thu, 26 Feb 2026 13:01:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id yJ8fNp1PxqbP; Thu, 26 Feb 2026 13:01:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136090; bh=7gqVi5XSHF1p5fGZWjS+KRdOSvk+EOPtRFVwGaDLIhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RRyUuKfAk+r+Z+cHVnMnXwpxEh262EsWHAJezPgeSYI1uVEhIsAOfLETO2TIt3iSe j1cq+vnJCswZ2Q8hu4i8tz5/WeNslVHJGbzexx9u/1bbp7ofmCiomwjDgHmd7q3bs3 VqmpY9Sd9RtE9q4YjpNuC/OrozHN7ebmoZccKKEXJIesU0C51C6GktgjBnpFux1XOE iUj4lYKvhUstUFL5oH6j9NdNvMdbUkS8+S050lmTToXztdePxn7YGDgMzTA7YUXu6S WV9XewNJPuInseMPi9gBqfDyXSE2ivnw5VSU0QwMKVZw3L6FPpW8rGzr++hsPLH9Kf vcs8jagnV0hHw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DF97469D79; Thu, 26 Feb 2026 13:01:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:07 -0700 Message-ID: <20260226200106.1727176-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TCVHIIF2MPCJEKQWVPGMWY5WGYKSS3HT X-Message-ID-Hash: TCVHIIF2MPCJEKQWVPGMWY5WGYKSS3HT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/32] patman: Expand the prep_series() comment List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The comment for prep_series() is quite terse. Expand it to describe what the function actually does. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 9 +++++++-- tools/patman/database.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index ea9881fcf6f..4289593b64b 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -255,11 +255,16 @@ class CseriesHelper: def prep_series(self, name, end=None): """Prepare to work with a series + Parse the branch name to determine the series name and version + number, then count the commits from the upstream branch (or up to the + end commit if provided) and collect the series metadata from those + commits. + Args: name (str): Branch name with version appended, e.g. 'fix2' end (str or None): Commit to end at, e.g. 'my_branch~16'. Only - commits up to that are processed. None to process commits up to - the upstream branch + commits up to that are processed. Use None to process commits up + to the upstream branch Return: tuple: str: Series name, e.g. 'fix' diff --git a/tools/patman/database.py b/tools/patman/database.py index 9c25b04a720..e6684f990da 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -41,7 +41,7 @@ Pcommit = namedtuple( 'idnum,seq,subject,svid,change_id,state,patch_id,num_comments') -class Database: +class Database: # pylint:disable=R0904 """Database of information used by patman""" # dict of databases: From patchwork Thu Feb 26 20:00:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1939 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136101; bh=T1i8rd6Aam4rByKSN7nGeJpSpcasvszD646nXjXk5Ok=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=umCU+kqpfuReo3Cta91gL5u0abI5r/gD7J+bf/nXPGqT2v/oS5L8aFJMBUxNdHoLX FTUqpQTZvz+qxtqz7Xr2D1rsYkj8sGvu+wjw9FKTnxakSd9oMNbqH2M619YgfPFdtl B7JMEAqYVSrj+rI6TSrKbzCjstnN9GQhkKo/yWlyIp4j2Sf5QaxWkmdhd/T7Ht/l4p yiP0/mE+Mm5ZSZEEyIgFh3Q7mCgWusvJPzqBC9nt4eO+uc9SVNX3Uh5lYSyL7OH7zc Jc9yEGsNtFrd9r64UbjQL4ZzfJAOjZTXAE2hx6lNLI5RkmV4DTWlAesCPizkJH+px6 gWMmQKcw4RORA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B4DDA69E36 for ; Thu, 26 Feb 2026 13:01:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eiZIOnpXRNxd for ; Thu, 26 Feb 2026 13:01:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136101; bh=T1i8rd6Aam4rByKSN7nGeJpSpcasvszD646nXjXk5Ok=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=umCU+kqpfuReo3Cta91gL5u0abI5r/gD7J+bf/nXPGqT2v/oS5L8aFJMBUxNdHoLX FTUqpQTZvz+qxtqz7Xr2D1rsYkj8sGvu+wjw9FKTnxakSd9oMNbqH2M619YgfPFdtl B7JMEAqYVSrj+rI6TSrKbzCjstnN9GQhkKo/yWlyIp4j2Sf5QaxWkmdhd/T7Ht/l4p yiP0/mE+Mm5ZSZEEyIgFh3Q7mCgWusvJPzqBC9nt4eO+uc9SVNX3Uh5lYSyL7OH7zc Jc9yEGsNtFrd9r64UbjQL4ZzfJAOjZTXAE2hx6lNLI5RkmV4DTWlAesCPizkJH+px6 gWMmQKcw4RORA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3E6369DAB for ; Thu, 26 Feb 2026 13:01:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136099; bh=msMgIEUdsVAD9SIfTiuRV/OfLAPuAFXkrjmDrd4W/Ks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5QSh9qOK9SBN5gFW8nvmUL0C/ey3ojx4Ta0qFyxJzRpFvMqMaZlpOtv2TAAHoplD u9Qo+t9fXHNfF1QSBNlVGvA0c8t5ikCKas/jyxtoIF597WKWJVCMIBHcFLjBqpwhTl t7fWZp5lGrewQbpqJPdcyrQVLS2WHfQd2uzYNtN+p0b92wRvcHHpzGSam5zqgPw18g 9uO/rr/xoTInCyfCynWKuZj/1vYEoYvSQJUMcg2udx5mec+N3JEMka0te9jYZxeMai 65lmBhc6zo7UYTBhsEcmJcxndlaoCFyh8H5wgc6Z8/YG0nyqBxNNKUh1DbyjXocIs+ +C/snpj8z6WHw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC22669D79; Thu, 26 Feb 2026 13:01:39 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 7_qRTd2wjXUH; Thu, 26 Feb 2026 13:01:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136095; bh=n3jA2J7yJNxMAbhxweHX5aM2CpI9rQbJTFQhx3AyNt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MR4WO0HX7CXp+/M70W73UJRlixqwTlVW5CNpTwoxWCajsQG4Ijf51R0RYe6YppZAL sMG9z0h2LhgdvauMvVNO8NY78FF9EXenUI/6CBF5Z0n/aWnrdqLQgIBmjmhWokJ46L LX33TK22xryeM+s14PSytO49Ut/mefRQfqiIXWyLG2VWlcyzCpv5Vq0prB5kZxGEGm go0tKCfTM+Kqd4qKuPSP6UWfzhVVI4+OjLm7uMJXnCqcJS8tSbIrCIQn6xVk5yM2Sf L5TNUq6rQzm5r/vr8K31NxhYzAq1E1+VWoAlituuWyjqTdl/KtyELMYI8jRBVXa9zA dyVn8Rvvjrelg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B46D669D4A; Thu, 26 Feb 2026 13:01:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:08 -0700 Message-ID: <20260226200106.1727176-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CZVKMTW2NXMIMGIAUMMH5WOTRRW4NICJ X-Message-ID-Hash: CZVKMTW2NXMIMGIAUMMH5WOTRRW4NICJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/32] patman: Reject database versions newer than supported List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass If a newer version of patman has upgraded the database schema beyond what the current patman understands, it goes into an infinite loop, trying to migrate. Exit with an error message instead. Signed-off-by: Simon Glass --- tools/patman/database.py | 6 ++++++ tools/patman/test_cseries.py | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tools/patman/database.py b/tools/patman/database.py index e6684f990da..4557c4ff3fc 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -86,6 +86,12 @@ class Database: # pylint:disable=R0904 def start(self): """Open the database read for use, migrate to latest schema""" self.open_it() + old_version = self.get_schema_version() + if old_version > LATEST: + self.close() + tout.fatal( + f'Database version {old_version} is too new (max' + f' {LATEST}); please update patman') self.migrate_to(LATEST) def open_it(self): diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 11724b1378f..3a9411033a6 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -3318,6 +3318,23 @@ Date: .* self.assertEqual(version, db.get_schema_version()) self.assertEqual(4, database.LATEST) + def test_migrate_future_version(self): + """Test that a database newer than patman is rejected""" + db = database.Database(f'{self.tmpdir}/.patman.db') + with terminal.capture(): + db.start() + + # Set the schema version beyond what patman supports + db.cur.execute( + f'UPDATE schema_version SET version = {database.LATEST + 1}') + db.commit() + db.close() + + with self.assertRaises(SystemExit): + with terminal.capture() as (_, err): + db.start() + self.assertIn('is too new', err.getvalue()) + def test_series_scan(self): """Test scanning a series for updates""" cser, _ = self.setup_second() From patchwork Thu Feb 26 20:00:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1940 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136106; bh=rcNKtgIDe+Q9UUY42vWt5Wr8UjHYkVAz+GkijMKCRmk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vQLMzHKz3vToXcONlIM1pT110II9kRLUiIJFcicKxKuKS4NsPLq2FypT6zsZxEUrk eeTHTY7qBgqa2PZntSJiOtCrQwm9Yuzkm38401dZg878NB6kbU32qjEW+HhoikoteN +0o6zUV7YMuKGXqvxjNwHFYp8Tsc8ADF4t6m2dEdf6O/46w0OsCckvj4B9n5n2VGv3 O4OmQfds7KOo5B+yIOmCXoyKkNQ8lEqkmfRSlhuasNFvPuTYP/Noec7rkiGG7MKj7+ l7GQ5Kevkf7F0rgjXtB3i73HIk1f09C/1BPBjcIZ5uajA47tjolYoJne0afZalkggX R3rTnLQ0qFQSA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3249C69D79 for ; Thu, 26 Feb 2026 13:01:46 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MB69hR7Ne3QE for ; Thu, 26 Feb 2026 13:01:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136106; bh=rcNKtgIDe+Q9UUY42vWt5Wr8UjHYkVAz+GkijMKCRmk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vQLMzHKz3vToXcONlIM1pT110II9kRLUiIJFcicKxKuKS4NsPLq2FypT6zsZxEUrk eeTHTY7qBgqa2PZntSJiOtCrQwm9Yuzkm38401dZg878NB6kbU32qjEW+HhoikoteN +0o6zUV7YMuKGXqvxjNwHFYp8Tsc8ADF4t6m2dEdf6O/46w0OsCckvj4B9n5n2VGv3 O4OmQfds7KOo5B+yIOmCXoyKkNQ8lEqkmfRSlhuasNFvPuTYP/Noec7rkiGG7MKj7+ l7GQ5Kevkf7F0rgjXtB3i73HIk1f09C/1BPBjcIZ5uajA47tjolYoJne0afZalkggX R3rTnLQ0qFQSA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 22A8469DAB for ; Thu, 26 Feb 2026 13:01:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136104; bh=MkXauGtMLamJl17GnZMYnVv3AXk43YWAXnJHf5ODyyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDZ0gnMOelgITXBw86VqBTjU/q3qsiD/2GGL5P+yvE9L6+GyjAxP0s5hbbMpkhk/P yzRgs2PB4hJw0GC5CGLA1CDVxxRmjXHbyMXCe33bdLu0NMcpDO7s49EeLF1xEMwpJM aacBUh3AGsMn/7WXgJMSaRXkY83cusD3EnCrckq792e3Dj8qmg1Fxaa91nuiDGY4gN pR79ZD7Hb/Whf8fZoPv6hsJhW0s0lHCIdBXU3MFBxSC2kr7QZ8vKWQXpFG5tleq3mk tbqZ9yjSYIrHdn1RgGhdurv9u6Cp+BXsZYS40ZnW5lDzxyc47Skvlt7ELxsbOHwEa+ tslc2QIcUA+Tg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4970369D79; Thu, 26 Feb 2026 13:01:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id kwXn73-yvslN; Thu, 26 Feb 2026 13:01:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136100; bh=MRwxQyphkOVhgqRknjEgayzeMuc2at6m0x6iT12OXKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rQPGtP6Utd7Jb01CQL8FaZIKT1mFY8WMIuPLtzzRF7+sTFaNs+cFJ23ThrYrlDzD9 1OPxzvKoqssWIk6mjE6+FxzR4DvF3BTuyFnSG9m20QLbwBqpfNlHmtB+/QIotnTjyM Nj8IRly3WPPjm0JMcpNDgUxyimgZIiZQc3TeyQOP8WTefOs5qOQpvSP+RMasAucR2f mXXYGdH6ZDl1EOX92n/ZChw1Vj607i52qUcoR9J5/qgKEQORES/ccQGB5eIfqF6LN+ WjKeL8G0/8Cz/axFyhzAXdKxC8KpOEjrKyIx6feJXU3aa1R+c60oLP48WUM7cy+TqU 6SlTiBS7C8Zfw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1FF7E69D4A; Thu, 26 Feb 2026 13:01:40 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:09 -0700 Message-ID: <20260226200106.1727176-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2Z6GL5YQJNH756P5L4JOBLHYZYNI5MJ2 X-Message-ID-Hash: 2Z6GL5YQJNH756P5L4JOBLHYZYNI5MJ2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/32] patman: Add upstream and send settings to the database schema List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a v5 migration to support per-upstream configuration. This allows each series to be associated with an upstream remote, each upstream to have its own patchwork URL and send settings (identity, series_to, no_maintainers, no_tags) and each series version to have its own description. The settings table is recreated without the UNIQUE constraint on name, since the same patchwork project can be associated with multiple upstreams. Signed-off-by: Simon Glass --- tools/patman/database.py | 38 +++++++++++++++++++++++++++++++++++- tools/patman/test_cseries.py | 2 +- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/tools/patman/database.py b/tools/patman/database.py index 4557c4ff3fc..2861ca69fa0 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -19,7 +19,7 @@ from u_boot_pylib import tout from patman.series import Series # Schema version (version 0 means there is no database yet) -LATEST = 4 +LATEST = 5 # Information about a series/version record SerVer = namedtuple( @@ -156,6 +156,40 @@ class Database: # pylint:disable=R0904 """Add an archive tag for each ser_ver""" self.cur.execute('ALTER TABLE ser_ver ADD COLUMN archive_tag') + def _migrate_to_v5(self): + """Add upstream support to series, settings and upstream tables + + - Add upstream column to series table + - Recreate settings table without UNIQUE constraint on name, adding + an upstream column (since the same project can have multiple + remotes) + - Add patchwork_url, identity, series_to, no_maintainers and + no_tags columns to upstream table + - Add desc column to ser_ver table + """ + self.cur.execute('ALTER TABLE series ADD COLUMN upstream') + + self.cur.execute( + 'CREATE TABLE settings_new ' + '(name, proj_id INT, link_name, upstream)') + self.cur.execute( + 'INSERT INTO settings_new SELECT name, proj_id, link_name, NULL ' + 'FROM settings') + self.cur.execute('DROP TABLE settings') + self.cur.execute('ALTER TABLE settings_new RENAME TO settings') + default_ups = self.upstream_get_default() + if default_ups: + self.cur.execute( + 'UPDATE settings SET upstream = ?', (default_ups,)) + + self.cur.execute('ALTER TABLE upstream ADD COLUMN patchwork_url') + self.cur.execute('ALTER TABLE upstream ADD COLUMN identity') + self.cur.execute('ALTER TABLE upstream ADD COLUMN series_to') + self.cur.execute( + 'ALTER TABLE upstream ADD COLUMN no_maintainers BIT') + self.cur.execute('ALTER TABLE upstream ADD COLUMN no_tags BIT') + self.cur.execute('ALTER TABLE ser_ver ADD COLUMN desc') + def migrate_to(self, dest_version): """Migrate the database to the selected version @@ -182,6 +216,8 @@ class Database: # pylint:disable=R0904 self._migrate_to_v3() elif version == 4: self._migrate_to_v4() + elif version == 5: + self._migrate_to_v5() # Save the new version if we have a schema_version table if version > 1: diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 3a9411033a6..5719d9b6ddc 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -3316,7 +3316,7 @@ Date: .* self.assertEqual(f'Update database to v{version}', out.getvalue().strip()) self.assertEqual(version, db.get_schema_version()) - self.assertEqual(4, database.LATEST) + self.assertEqual(5, database.LATEST) def test_migrate_future_version(self): """Test that a database newer than patman is rejected""" From patchwork Thu Feb 26 20:00:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1941 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136111; bh=mvrmAw685owT2ktsLCJMYdY5FfNVmymO+0O7h42MW1U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IYNq2Tba+LkhyXxbk8s3mHXEi+7xM9c/51fscpyCnPP6nkIjbG6FzH5bp+yIYLXBn sF8zLZ8VlIqKpSOZglM3UQoP/+M681UO9gg8oNZog7dGXOYZofleqvcCDJ9mVYBtcq tQ5Teo9Xwy9Uju6N9FmmZcya+uwWICbl7ysiIzJkSADg18T3T6w2JU5gCMAvdHmMFh a87KY1lT/wTXDnM4SuFzk46v1AdkWX9JxgQ8LVtA3TYqrEP3fvVPFdU6ar9xMGu0ea BRPKBLc9NuoYojAO2VetaG8MXRwAQ/OmYCF/dPBdTRSOGc2xL9kLAzB7mKu9Nj4Gb2 v4vOlN4ZTcKbg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1EB6369E36 for ; Thu, 26 Feb 2026 13:01:51 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HBhDAxaUDi5g for ; Thu, 26 Feb 2026 13:01:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136111; bh=mvrmAw685owT2ktsLCJMYdY5FfNVmymO+0O7h42MW1U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IYNq2Tba+LkhyXxbk8s3mHXEi+7xM9c/51fscpyCnPP6nkIjbG6FzH5bp+yIYLXBn sF8zLZ8VlIqKpSOZglM3UQoP/+M681UO9gg8oNZog7dGXOYZofleqvcCDJ9mVYBtcq tQ5Teo9Xwy9Uju6N9FmmZcya+uwWICbl7ysiIzJkSADg18T3T6w2JU5gCMAvdHmMFh a87KY1lT/wTXDnM4SuFzk46v1AdkWX9JxgQ8LVtA3TYqrEP3fvVPFdU6ar9xMGu0ea BRPKBLc9NuoYojAO2VetaG8MXRwAQ/OmYCF/dPBdTRSOGc2xL9kLAzB7mKu9Nj4Gb2 v4vOlN4ZTcKbg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0D55B69D79 for ; Thu, 26 Feb 2026 13:01:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136108; bh=R6OwqiPQ7kXoVGVQ1NrSrO/xvHKmL6hQF38F6v5mIFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FIuSVwJrBPMQlIegMVJ/Y9cg614Z+iKKvCyhgysJI5MXcMBvANueFv/SePgUkCFYY hJpSMlCDX4n9UGRHQ+i5uajXSpgPq1evWEw8bBslZgg2M/F4nASqKixQqso+QZAZ4p dNSKi9pGCyarPCUAa3dfpu3DEdMT0Af3XojVZuir5kw8vK+eIpQOW4ONqa62gH2+oY jdZHPYpcpscfcVuDs+vq93MoDPDYThNuc2AV+J1kmlBYzM2JOrlIph0sfhggHW25pX E/8zpOpqWLvKfywG1vgN4vqRrPaDKKEWeewqLXSkk1HCQh3yoezt9uxXOisT7xjTop 0MxD6Palu4uCg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1F7369D79; Thu, 26 Feb 2026 13:01:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id lzuqjq9Jj3Lg; Thu, 26 Feb 2026 13:01:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136104; bh=BhnNPAxRAPGrD7HtK3pVBsEc8lEQW1Y+Py66j2IrVpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9r/gcBEzcaArvuEGrs7sBOIJgjosnigc+Vh597wfWNEP7Xb9SbNA0i+szudlVVUf a180pG9oxz2/yLuiwxx7GySwM4A2hvBnIMkCnzmWBduZ+Gy6YYi9TabRtxpb34rCd7 YfYb1zkBj3qe7/80+2IpcBkX2KJfzUNjElZFEOQDBjPjyNLK2jyIkrq3KNntP/RHm5 pwWD1CShX5nYcmQOqkiMbOGSMugon+pR3nANmf1xg6AKWrbA0D12D1PSf2dbXvnzP4 9SHfUWUd+icv6nD823TE0ZeUMkdeZEZS7k9KQjdE3AwYVvR7BK7ES/sbAA1PTOEvUW m7zZJC349nr0g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8769969D4A; Thu, 26 Feb 2026 13:01:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:10 -0700 Message-ID: <20260226200106.1727176-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RL3FHNWFTWJAKSPE3FOE3A7PGDXUTKQE X-Message-ID-Hash: RL3FHNWFTWJAKSPE3FOE3A7PGDXUTKQE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/32] patman: Add an upstream column to the series table List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Series are not currently associated with a particular upstream. Add an 'upstream' column to the series table (schema v5) so each series can record which upstream it targets. This stores the upstream name as a string reference to the upstream table's name column. Add series_set_upstream() for updating an existing series, and extend series_add(), series_get_info() and _get_series_list() to handle the new column. Update Series.from_fields() to require the upstream parameter. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 9 +++++---- tools/patman/database.py | 31 +++++++++++++++++++++++-------- tools/patman/series.py | 3 ++- tools/patman/test_cseries.py | 30 ++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index 4289593b64b..1441904686c 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -246,6 +246,7 @@ class CseriesHelper: Return: tuple: str: Series name str: Series description + str or None: Upstream name Raises: ValueError: Series is not found @@ -400,9 +401,9 @@ class CseriesHelper: idnum = self.db.series_find_by_name(name, include_archived) if not idnum: return None - name, desc = self.db.series_get_info(idnum) + name, desc, ups = self.db.series_get_info(idnum) - return Series.from_fields(idnum, name, desc) + return Series.from_fields(idnum, name, desc, ups) def _get_branch_name(self, name, version): """Get the branch name for a particular version @@ -1441,7 +1442,7 @@ class CseriesHelper: int: Number of version which need a 'scan' """ max_vers = self._series_max_version(ser.idnum) - name, desc = self._get_series_info(ser.idnum) + name, desc, ups = self._get_series_info(ser.idnum) coloured = self.col.build(self.col.BLACK, desc, bright=False, back=self.col.YELLOW) versions = self._get_version_list(ser.idnum) @@ -1487,7 +1488,7 @@ class CseriesHelper: all series """ max_vers = self._series_max_version(ser.idnum) - name, desc = self._get_series_info(ser.idnum) + name, desc, ups = self._get_series_info(ser.idnum) stats, pwc = self._series_get_version_stats(ser.idnum, max_vers) states = {x.state for x in pwc.values()} state = 'accepted' diff --git a/tools/patman/database.py b/tools/patman/database.py index 2861ca69fa0..e3df4257f8c 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -295,10 +295,11 @@ class Database: # pylint:disable=R0904 list of Series """ res = self.execute( - 'SELECT id, name, desc FROM series ' + + 'SELECT id, name, desc, upstream FROM series ' + ('WHERE archived = 0' if not include_archived else '')) - return [Series.from_fields(idnum=idnum, name=name, desc=desc) - for idnum, name, desc in res.fetchall()] + return [Series.from_fields(idnum=idnum, name=name, desc=desc, + ups=ups) + for idnum, name, desc, ups in res.fetchall()] # series functions @@ -349,12 +350,14 @@ class Database: # pylint:disable=R0904 Return: tuple: str: Series name str: Series description + str or None: Upstream name Raises: ValueError: Series is not found """ - res = self.execute('SELECT name, desc FROM series WHERE id = ?', - (idnum,)) + res = self.execute( + 'SELECT name, desc, upstream FROM series WHERE id = ?', + (idnum,)) recs = res.fetchall() if len(recs) != 1: raise ValueError(f'No series found (id {idnum} len {len(recs)})') @@ -417,7 +420,7 @@ class Database: # pylint:disable=R0904 'GROUP BY series_id') return res.fetchall() - def series_add(self, name, desc): + def series_add(self, name, desc, ups=None): """Add a new series record The new record is set to not archived @@ -425,13 +428,14 @@ class Database: # pylint:disable=R0904 Args: name (str): Series name desc (str): Series description + ups (str or None): Name of the upstream for this series Return: int: ID num of the new series record """ self.execute( - 'INSERT INTO series (name, desc, archived) ' - f"VALUES ('{name}', '{desc}', 0)") + 'INSERT INTO series (name, desc, archived, upstream) ' + 'VALUES (?, ?, 0, ?)', (name, desc, ups)) return self.lastrowid() def series_remove(self, idnum): @@ -481,6 +485,17 @@ class Database: # pylint:disable=R0904 self.execute( 'UPDATE series SET name = ? WHERE id = ?', (name, series_idnum)) + def series_set_upstream(self, series_idnum, ups): + """Update upstream for a series + + Args: + series_idnum (int): ID num of the series + ups (str or None): Name of the upstream, or None to clear + """ + self.execute( + 'UPDATE series SET upstream = ? WHERE id = ?', + (ups, series_idnum)) + # ser_ver functions def ser_ver_get_link(self, series_idnum, version): diff --git a/tools/patman/series.py b/tools/patman/series.py index 517fd4304f5..9985533ee52 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -72,11 +72,12 @@ class Series(dict): return self[name] @staticmethod - def from_fields(idnum, name, desc): + def from_fields(idnum, name, desc, ups): ser = Series() ser.idnum = idnum ser.name = name ser.desc = desc + ser.upstream = ups return ser def AddTag(self, commit, line, name, value): diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 5719d9b6ddc..fc29e9a7bef 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1879,6 +1879,36 @@ Tested-by: Mary Smith # yak self.run_args('upstream', 'list') self.assertFalse(out.getvalue().strip()) + def test_series_upstream(self): + """Test upstream field in the series table""" + cser = self.get_cser() + + # Add a series without upstream + cser.db.series_add('first', 'my desc') + cser.db.commit() + slist = cser.db.series_get_dict() + self.assertIsNone(slist['first'].upstream) + + # Add a series with upstream + cser.db.series_add('second', 'desc2', ups='us') + cser.db.commit() + slist = cser.db.series_get_dict() + self.assertIsNone(slist['first'].upstream) + self.assertEqual('us', slist['second'].upstream) + + # Update upstream on existing series + idnum = cser.db.series_find_by_name('first') + cser.db.series_set_upstream(idnum, 'ci') + cser.db.commit() + slist = cser.db.series_get_dict() + self.assertEqual('ci', slist['first'].upstream) + + # Clear upstream + cser.db.series_set_upstream(idnum, None) + cser.db.commit() + slist = cser.db.series_get_dict() + self.assertIsNone(slist['first'].upstream) + def test_series_add_mark(self): """Test marking a cseries with Change-Id fields""" cser = self.get_cser() From patchwork Thu Feb 26 20:00:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1942 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136114; bh=uPs+LPsHGK4zYlrMQXDnRvfr6qs85G8E1RBRitWiEt4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=roXmsgcBy28SkWABx5Z8AgGnZxWYXVAXEE20e5fhZ+VTW7F6Voo3tcKy2N6Vpdh1C 7FcVPTVst8lvh7PAhfGKkxcU9ow6XOIXmUZ8ypIR7b/j33gVu3iSbMM6mW759nWV8L 0OUL/Wvzsol3JAzFl/KyrOXE3l1jNkUw1wJCs4cxPL/QrmHPWZuqiMAfcIMuw5GwX1 Kt/d1/VkI0SMJKQQv58KzLLGesMn/N1psQLpL4MNxBk2sZ4qTa8GfS6im0U0i6W3pR YuMqb+W4RkdBZFuB0xFJQzRd0Pti6BZ7uB+w/lj2Ubsz1O8tGaYZnrvx1Pgus7Hzp6 F+PaIV076p7qA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABC7269E36 for ; Thu, 26 Feb 2026 13:01:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id dUaesI6904aL for ; Thu, 26 Feb 2026 13:01:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136114; bh=uPs+LPsHGK4zYlrMQXDnRvfr6qs85G8E1RBRitWiEt4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=roXmsgcBy28SkWABx5Z8AgGnZxWYXVAXEE20e5fhZ+VTW7F6Voo3tcKy2N6Vpdh1C 7FcVPTVst8lvh7PAhfGKkxcU9ow6XOIXmUZ8ypIR7b/j33gVu3iSbMM6mW759nWV8L 0OUL/Wvzsol3JAzFl/KyrOXE3l1jNkUw1wJCs4cxPL/QrmHPWZuqiMAfcIMuw5GwX1 Kt/d1/VkI0SMJKQQv58KzLLGesMn/N1psQLpL4MNxBk2sZ4qTa8GfS6im0U0i6W3pR YuMqb+W4RkdBZFuB0xFJQzRd0Pti6BZ7uB+w/lj2Ubsz1O8tGaYZnrvx1Pgus7Hzp6 F+PaIV076p7qA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 98D3969D79 for ; Thu, 26 Feb 2026 13:01:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136112; bh=fucDmVVhLTyiq+J7MoN1an4um10g6uO9lKCaIUWAD1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXJk2/Ch3AIIDzjjL9iUpeMdelbCFgKg5RhzJ7DuFnO/p08sUJPsjGcnqEn0y3o6Y zgTikTfmFMysEQPEg5Pb97m6Ne1/LrLYFIXLO/dAE2MjSAWG0c/aWTeYl44b8+TlZy oFpo2Wx1zPldIwjv4JpBxP2sMjif9n+bQ0E9OfDPfBdrghl3cJav1SW4Ke6k/6Wr1y tL7fMPMyxEFra4vIs5EnWJKzaix36mhmYByzB7tbL578UHsh17F2MZ5rrInny/rqCd rfcc6W64uvRRHwOqOV6xFp+8kUv96xG+Wgo2ZKENB2RXMfHmmZO18qynj4AWynVA2e sHs8KQUD0wo5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E65EA69D79; Thu, 26 Feb 2026 13:01:52 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id kCKqpiPhtGxC; Thu, 26 Feb 2026 13:01:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136109; bh=pDhHcaJyNwinmvv+a6OjMnraUL6PUwjn7724bddMCCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BbBAeRcCQma/XlJIYeaFl2qI+KjzKwkndL/rsNNcZNjS6C0q6PGD9mtv9ZJdr2JeG al0gwZPQAXi5QY+oPaOVDrmYjuvyrfchugB+auZS283Nj32aHhdL62zB2WI4W2SvtV jELelQ+DjgBVTCz0v8oBcrU6dpMarytZa9K3iLr/qP+6Zb4HPJtWIqc8u+cgiY4ywr cTt0ZtOkSQwrEoECHsrTjaiUVOFOAfvZLiflnpsLqEMbH6JFtym9lsCQUy7sFYhKQA 6tSXqEb+33CTmsPr9ElnheB9A3rGibAGwg/+JRNu4fGz7CTFX37hM6RFLqst+HSJ43 4GV48VipbKqdg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C69DB69D4A; Thu, 26 Feb 2026 13:01:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:11 -0700 Message-ID: <20260226200106.1727176-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GJOR5OT3A2NRPSDJSHRNH5GRKCNZHQQE X-Message-ID-Hash: GJOR5OT3A2NRPSDJSHRNH5GRKCNZHQQE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/32] patman: Warn about series with no upstream after migration List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When the database is upgraded from before v5, existing series will have a NULL upstream. Detect this after migration and print a warning listing the affected series, so the user knows to set an upstream for them. Add series_get_null_upstream() to query for series with NULL upstream. Have start() return the old schema version so callers can check whether a migration from a particular version occurred. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 13 ++++++++- tools/patman/database.py | 20 +++++++++++++- tools/patman/test_cseries.py | 52 ++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index 1441904686c..0b29d52bc00 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -110,11 +110,22 @@ class CseriesHelper: # For the first instance, start it up with the expected schema self.db, is_new = Database.get_instance(fname) if is_new: - self.db.start() + old_version = self.db.start() + if old_version is not None and old_version < 5: + self._check_null_upstreams() else: # If a previous test has already checked the schema, just open it self.db.open_it() + def _check_null_upstreams(self): + """Warn about series that have no upstream set""" + names = self.db.series_get_null_upstream() + if names: + tout.warning( + f'{len(names)} series without an upstream:') + for name in names: + tout.warning(f' {name}') + def close_database(self): """Close the database""" if self.db: diff --git a/tools/patman/database.py b/tools/patman/database.py index e3df4257f8c..2bd225e4deb 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -84,7 +84,12 @@ class Database: # pylint:disable=R0904 return Database(db_path), True def start(self): - """Open the database read for use, migrate to latest schema""" + """Open the database ready for use, migrate to latest schema + + Return: + int or None: Schema version before migration, or None if no + migration was needed + """ self.open_it() old_version = self.get_schema_version() if old_version > LATEST: @@ -93,6 +98,9 @@ class Database: # pylint:disable=R0904 f'Database version {old_version} is too new (max' f' {LATEST}); please update patman') self.migrate_to(LATEST) + if old_version == LATEST: + return None + return old_version def open_it(self): """Open the database, creating it if necessary""" @@ -496,6 +504,16 @@ class Database: # pylint:disable=R0904 'UPDATE series SET upstream = ? WHERE id = ?', (ups, series_idnum)) + def series_get_null_upstream(self): + """Get a list of series names that have no upstream set + + Return: + list of str: Series names with NULL upstream + """ + res = self.execute( + 'SELECT name FROM series WHERE upstream IS NULL') + return [row[0] for row in res.fetchall()] + # ser_ver functions def ser_ver_get_link(self, series_idnum, version): diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index fc29e9a7bef..cf0d8cfdab6 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -3365,6 +3365,58 @@ Date: .* db.start() self.assertIn('is too new', err.getvalue()) + def test_migrate_upstream_warning(self): + """Test that migrating to v5 warns about series without upstream""" + db = database.Database(f'{self.tmpdir}/.patman2.db') + with terminal.capture(): + db.open_it() + + # Create a v4 database with some series + with terminal.capture() as (out, _): + db.migrate_to(4) + self.assertEqual( + 'Update database to v1\nUpdate database to v2\n' + 'Update database to v3\nUpdate database to v4', + out.getvalue().strip()) + db.execute( + "INSERT INTO series (name, desc, archived) " + "VALUES ('first', 'desc1', 0)") + db.execute( + "INSERT INTO series (name, desc, archived) " + "VALUES ('second', 'desc2', 0)") + db.execute( + "INSERT INTO series (name, desc, archived) " + "VALUES ('third', 'desc3', 0)") + db.commit() + db.close() + + # Now open via CseriesHelper which triggers migration and check + self.make_git_tree() + cser = cseries.Cseries(self.tmpdir, terminal.COLOR_NEVER) + cser.topdir = self.tmpdir + + # Point at our v4 database + database.Database.instances = {} + cser.db, _ = database.Database.get_instance( + f'{self.tmpdir}/.patman2.db') + with terminal.capture() as (_, err): + old_version = cser.db.start() + self.assertEqual(4, old_version) + + # Set upstream on one series so only two are reported + idnum = cser.db.series_find_by_name('second') + cser.db.series_set_upstream(idnum, 'us') + cser.db.commit() + + with terminal.capture() as (_, err): + cser._check_null_upstreams() + lines = err.getvalue().strip().splitlines() + self.assertEqual('2 series without an upstream:', lines[0]) + self.assertEqual(' first', lines[1]) + self.assertEqual(' third', lines[2]) + + cser.db.close() + def test_series_scan(self): """Test scanning a series for updates""" cser, _ = self.setup_second() From patchwork Thu Feb 26 20:00:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1943 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136116; bh=GhZr1R7CIxatAg/ENX/sW5FjxWbgSk7Bvy8oT0QkjP0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=doesnAZcEPdnzLdOGR7amkjtuO3cgchY0ZZU4siJEzvPtV2xUddWXP3WRBm+iy/Uv ZOCh/jxgv26fXsde0qRyS1T4sH/ehcdahIRnP1O0dZLpFb6dPK7Ue5kl3w1fepZ4Rr k+ZBn8c8MJvvhxoAserLCmio0Nb2RQwesbFlG1vjrdFw8nXDzlu8ghuY0dahSm+cjr mmeY86v3oosKCRotqqtWFc49AiKf2qGBYFBMMDxsjjadTVn6dmoNk+fVto7SjB1qrR gpT39YMIb+itr0v+DqlyZ6K9w19tbIJPeie5Av28bjJvqAp96BOSUSoKfGT0hXEMhy cz0hhwDmKtlmA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 280E169E36 for ; Thu, 26 Feb 2026 13:01:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nwJ33b7oZrDJ for ; Thu, 26 Feb 2026 13:01:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136116; bh=GhZr1R7CIxatAg/ENX/sW5FjxWbgSk7Bvy8oT0QkjP0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=doesnAZcEPdnzLdOGR7amkjtuO3cgchY0ZZU4siJEzvPtV2xUddWXP3WRBm+iy/Uv ZOCh/jxgv26fXsde0qRyS1T4sH/ehcdahIRnP1O0dZLpFb6dPK7Ue5kl3w1fepZ4Rr k+ZBn8c8MJvvhxoAserLCmio0Nb2RQwesbFlG1vjrdFw8nXDzlu8ghuY0dahSm+cjr mmeY86v3oosKCRotqqtWFc49AiKf2qGBYFBMMDxsjjadTVn6dmoNk+fVto7SjB1qrR gpT39YMIb+itr0v+DqlyZ6K9w19tbIJPeie5Av28bjJvqAp96BOSUSoKfGT0hXEMhy cz0hhwDmKtlmA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FCDE69DAB for ; Thu, 26 Feb 2026 13:01:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136113; bh=zT9wm7ghFXPWW1lOHdAUg/2I78nOa17SX+VmRtyNFOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aXibTxe6oA5qvgpjQrlacr2dKO8zNtzqAUmJAoXAMA0dPOIlazyhYLXy9jaYfT6l/ ZmXywBrIMkzBqdknzrwbRsSQANKXQEbkSMK3Z4cYzPjvpQHFhpJ7hggk/i3ZpRhK8S SjTYEf412YDbMRyhgW3PQwS7HSapqT2/wqt6kX0dwQH2R0xH4Vj3Ino03nVysEXRI0 QZIUPcS0icdtPNwRo/gMoN1KUdWeVJrh2cUuM98S/8FwfLddmlo+qr90hhFLXua7Pr iI3r0HJKug/bKZkXGal/W1dvCCuzO834boQuMm2bZNZlAom7vVu3fJU+8opu/Yyfpo 52s0WliqQFs6Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C47BB69D79; Thu, 26 Feb 2026 13:01:53 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 1KaNCiuPl-n5; Thu, 26 Feb 2026 13:01:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136113; bh=BURl7ywfReA11e/aPRJlRlDrQDa1GhzJxND1xI8kC04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nKQUdZUDfaYEzasK6HidWS+PkRGNZAcpdsSouuVQQWhZ2BeonbMCk3wws5Z7Enrf4 ici2aSm+Ot3t3qV4+TuG7aaIl6qXisMfDmJNV53Z3GdLhnGt4ouhQViHA/zLjc6CaM Wck72pajbrBnfZCsnJugjHLVeQGT2DmguAWalo0R3lbMJrYeFWg0q+FfL5BcqRx4Rg wWg+ikV+y48SThhxaEcAgQ6kjwLmfaTsHx0FtRNjFYfdFyIg7b1inBXw93BhPYUOij FZJa8KON0S4gCXxxYBD1F2vfUjmC26L3HtLVkuP2fCoOKXS84FOhVJvIB1AoeBqT4D HSUBanD2adnRQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 34B5169D4A; Thu, 26 Feb 2026 13:01:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:12 -0700 Message-ID: <20260226200106.1727176-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ICDR55NQEEM5MESCB26FZCRIJFZTRHJ6 X-Message-ID-Hash: ICDR55NQEEM5MESCB26FZCRIJFZTRHJ6 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/32] patman: Auto-detect upstream for series during migration List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When the database is upgraded to v5, try to auto-detect the upstream for each series that has a NULL upstream. This queries the git branch's remote tracking configuration and sets the upstream if a real remote (not local tracking with '.') is found. Series where auto-detection fails are still reported as a warning so the user can set them manually. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 35 +++++++++++++++++++++++++++++++---- tools/patman/test_cseries.py | 32 ++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index 0b29d52bc00..74bccfcfbc6 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -118,12 +118,39 @@ class CseriesHelper: self.db.open_it() def _check_null_upstreams(self): - """Warn about series that have no upstream set""" + """Detect and warn about series that have no upstream set + + For each series without an upstream, try to detect it from the + git branch's remote tracking configuration. Any series that + cannot be auto-detected are reported as a warning. + """ names = self.db.series_get_null_upstream() - if names: + if not names: + return + + still_null = [] + git_dir = self.gitdir or '.git' + for name in names: + remote_name = None + if gitutil.check_branch(name, git_dir=self.gitdir): + us_ref, _ = gitutil.get_upstream(git_dir, name) + if us_ref and '/' in us_ref and not us_ref.startswith( + 'refs/'): + remote_name = us_ref.split('/')[0] + if remote_name: + idnum = self.db.series_find_by_name(name) + self.db.series_set_upstream(idnum, remote_name) + tout.progress(f"Set upstream for series '{name}' to " + f"'{remote_name}'", trailer='') + else: + still_null.append(name) + + if len(still_null) < len(names): + self.db.commit() + if still_null: tout.warning( - f'{len(names)} series without an upstream:') - for name in names: + f'{len(still_null)} series without an upstream:') + for name in still_null: tout.warning(f' {name}') def close_database(self): diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index cf0d8cfdab6..23527cfa8f0 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -3367,11 +3367,20 @@ Date: .* def test_migrate_upstream_warning(self): """Test that migrating to v5 warns about series without upstream""" + self.make_git_tree() + + # Set 'first' branch to track a remote-style upstream so that + # auto-detection can find it + self.repo.config.set_multivar('branch.first.remote', '', 'origin') + self.repo.config.set_multivar('branch.first.merge', '', + 'refs/heads/main') + db = database.Database(f'{self.tmpdir}/.patman2.db') with terminal.capture(): db.open_it() - # Create a v4 database with some series + # Create a v4 database with some series; 'first' has a matching + # branch with a detectable remote, 'second' and 'third' do not with terminal.capture() as (out, _): db.migrate_to(4) self.assertEqual( @@ -3390,10 +3399,9 @@ Date: .* db.commit() db.close() - # Now open via CseriesHelper which triggers migration and check - self.make_git_tree() cser = cseries.Cseries(self.tmpdir, terminal.COLOR_NEVER) cser.topdir = self.tmpdir + cser.gitdir = self.gitdir # Point at our v4 database database.Database.instances = {} @@ -3403,18 +3411,22 @@ Date: .* old_version = cser.db.start() self.assertEqual(4, old_version) - # Set upstream on one series so only two are reported - idnum = cser.db.series_find_by_name('second') - cser.db.series_set_upstream(idnum, 'us') - cser.db.commit() - - with terminal.capture() as (_, err): + # 'first' should be auto-detected, 'second' and 'third' have no + # matching branch with a remote upstream + with terminal.capture() as (out, err): cser._check_null_upstreams() + self.assertIn("Set upstream for series 'first' to 'origin'", + out.getvalue()) lines = err.getvalue().strip().splitlines() self.assertEqual('2 series without an upstream:', lines[0]) - self.assertEqual(' first', lines[1]) + self.assertEqual(' second', lines[1]) self.assertEqual(' third', lines[2]) + # Check that 'first' was actually updated in the database + slist = cser.db.series_get_dict() + self.assertEqual('origin', slist['first'].upstream) + self.assertIsNone(slist['second'].upstream) + cser.db.close() def test_series_scan(self): From patchwork Thu Feb 26 20:00:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1944 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136120; bh=V9sNu3tF6V2ZCTKDcYnqn1u3MqJM53OeDH/+kwS+cHI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PEX4+c8l+hGfJfrvPkAC33FDcTsZAyUVI3R/5snk+dqLZUNAddaEQJ68NxMmquz48 vpZIJDunvkV1UEZceOYuJWZm5jwZOMk7Ydcf7Xhezg1AKiQoShumpGTO2V8f/G5sRz 9YJJmHGlYQzl1OBUnG4o2UEq7QbBh+q2tQyYdkuiDG9X6UIngQUDkbHu3MN4joSEMV tMFsZdHBT6EpjQZpuFASmKqvyfrY9kwRVzrz0AuKdl6DFKEb25P7gS23nNAyHRPenL xQYoHzrRhkEHFQ3s4VdtPX/mYE83znT1iHJ2NRyN/oo3pB7MKDEBl4j3k89qaSmRmy G4QLGXn2WM6DQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AE1869E36 for ; Thu, 26 Feb 2026 13:02:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pPBAqWyETaZo for ; Thu, 26 Feb 2026 13:02:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136120; bh=V9sNu3tF6V2ZCTKDcYnqn1u3MqJM53OeDH/+kwS+cHI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PEX4+c8l+hGfJfrvPkAC33FDcTsZAyUVI3R/5snk+dqLZUNAddaEQJ68NxMmquz48 vpZIJDunvkV1UEZceOYuJWZm5jwZOMk7Ydcf7Xhezg1AKiQoShumpGTO2V8f/G5sRz 9YJJmHGlYQzl1OBUnG4o2UEq7QbBh+q2tQyYdkuiDG9X6UIngQUDkbHu3MN4joSEMV tMFsZdHBT6EpjQZpuFASmKqvyfrY9kwRVzrz0AuKdl6DFKEb25P7gS23nNAyHRPenL xQYoHzrRhkEHFQ3s4VdtPX/mYE83znT1iHJ2NRyN/oo3pB7MKDEBl4j3k89qaSmRmy G4QLGXn2WM6DQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7920A69DAB for ; Thu, 26 Feb 2026 13:02:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136118; bh=XRuqjsOt1YL8Fs0J2w5pFiui23Ex0D5ZG1NTWq8UEv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3rsfbOBzbpXmmF7m65dWo69AEll7NDRFQXEPDZ9EG8vC0ozoqteqld7EFuWzuA9m CjTEsZ6iXyT21LOGgqvSCeLPqgmDEyT6VKBcS70Ln1NgvTQXyPKO4PzHXJ9URnwRjY gShwfEtr0p07odMO1lJY+NnE0Ycb1UIawCyCGIqDKAL9quSwouyaQO58nD2j6hcSzz ggOOq0hSB1B1qEkfGFY3g6a1GkV+wc69qZZkCbG0HP/F9HO4IoGJbi7AJZeo2cvQZl 2Ew1ubnVazPM4tKUfG0jHQyI/timygjJD4IySK6GfhfooK4vEwsIdfsnWKz+voVMhp h4dIvMn8qHJhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7E3FE69D79; Thu, 26 Feb 2026 13:01:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id nT7mVA-UqvKE; Thu, 26 Feb 2026 13:01:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136114; bh=PTK5c1lodgRJUSgDWgjy3ksGO+TqOTVJonQCmXx5ERE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vX1lG6DTCErGcsfPKgjE03dyCdD6Fm0AGFO1Si4ATv5ibT1LNUFqhyzfmg2d3+vYn Oouz2kN7W2nbMjTyyuFJPYHM+BkntrPvcfbtOg4A7nB9+LudpdlaYs0rhOLfkDaj+7 TWkPCC4RbltqjMuiCQBhITfaDdI3CzkqpUh7MEj4zCS7bj4+EJ188Y29mDOEhDFkMb VVaY6KeXh45GVjrwhWir3D9fmz4iDfuqLwQNZ2/d8t4m0UqF+FwNjWrLzWPvKMTsCB Xp4xY1WW4eLcSzMLCmYwLkorR/w9OatH1U70KEA5I6bxjOIob8Bd3eylV3FEZwehYP rPZKx8rXg3sRg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 14FDB69D4A; Thu, 26 Feb 2026 13:01:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:13 -0700 Message-ID: <20260226200106.1727176-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KZZZROMV2ZDBWRB6MDMF5MOHQ42EC5AE X-Message-ID-Hash: KZZZROMV2ZDBWRB6MDMF5MOHQ42EC5AE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/32] patman: Show upstream in series list List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Update 'series ls' to display a two-character upstream abbreviation before the version column, making it easy to see which remote each series targets. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 8 +++++--- tools/patman/test_cseries.py | 14 +++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index c90020b7eb6..6c918185387 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -408,18 +408,20 @@ class Cseries(cser_helper.CseriesHelper): include_archived (bool): True to include archived series also """ sdict = self.db.series_get_dict(include_archived) - print(f"{'Name':15} {'Description':40} Accepted Versions") - border = f"{'-' * 15} {'-' * 40} -------- {'-' * 15}" + print(f"{'Name':15} {'Description':40} Accepted Us Versions") + border = f"{'-' * 15} {'-' * 40} -------- -- {'-' * 15}" print(border) for name in sorted(sdict): ser = sdict[name] versions = self._get_version_list(ser.idnum) stat = self._series_get_version_stats( ser.idnum, self._series_max_version(ser.idnum))[0] + ups = (ser.upstream or '')[:2] vlist = ' '.join([str(ver) for ver in sorted(versions)]) - print(f'{name:16.16} {ser.desc:41.41} {stat.rjust(8)} {vlist}') + print(f'{name:16.16} {ser.desc:41.41} {stat.rjust(8)} ' + f'{ups:2} {vlist}') print(border) def list_patches(self, series, version, show_commit=False, diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 23527cfa8f0..e529d9fe61b 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -759,14 +759,14 @@ Tested-by: Mary Smith # yak self.assertEqual(5, len(lines)) self.assertEqual( 'Name Description ' - 'Accepted Versions', lines[0]) + 'Accepted Us Versions', lines[0]) self.assertTrue(lines[1].startswith('--')) self.assertEqual( 'first ' - ' -/2 1', lines[2]) + ' -/2 1', lines[2]) self.assertEqual( 'second Series for my board ' - ' 1/3 1 2', lines[3]) + ' 1/3 1 2', lines[3]) self.assertTrue(lines[4].startswith('--')) def test_series_list_archived(self): @@ -780,7 +780,7 @@ Tested-by: Mary Smith # yak self.assertEqual(4, len(lines)) self.assertEqual( 'second Series for my board ' - ' 1/3 1 2', lines[2]) + ' 1/3 1 2', lines[2]) # Now list including archived series with terminal.capture() as (out, _): @@ -789,10 +789,10 @@ Tested-by: Mary Smith # yak self.assertEqual(5, len(lines)) self.assertEqual( 'first ' - ' -/2 1', lines[2]) + ' -/2 1', lines[2]) self.assertEqual( 'second Series for my board ' - ' 1/3 1 2', lines[3]) + ' 1/3 1 2', lines[3]) def test_do_series_add(self): """Add a new cseries""" @@ -821,7 +821,7 @@ Tested-by: Mary Smith # yak self.assertTrue(lines[1].startswith('--')) self.assertEqual( 'first my-description ' - '-/2 1', lines[2]) + '-/2 1', lines[2]) def test_do_series_add_cmdline(self): """Add a new cseries using the cmdline""" From patchwork Thu Feb 26 20:00:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1945 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136125; bh=L1WY3pDcL1KxopCYeUdcm9kmRkO9Dv3pMPwxA/EqRSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=t/2NQVuMgzryW+xnO69aHoFUkO3rSxW440boalSxtK99ckYzwQarMQOEFJpeoBbwY VDigvrayCgB/uM+C4Stc93JCftymVOSMyOnNTjsY44xEUs5EI7ma0AGjI7QN5pYt31 kRuMcosuYN6dh7O3pYAzo0wqyh2BJyKXQvb7RmXHsHc4Cdy5Z7VMY6NrapXzSWT3eg XDUH02Pd8e9iSYiF0YtvfRbmgcSw6G2DfRrocMmMiKuoL73POxVt/Nj5m7V9mz8MbK cq8j1eO2uhSV0e/sW6wRaQibjLUUdV2uiTmYzPlC/aw53hZ07pcnS+tLvfLV7XHX4Z JjWd1UkaQmbGA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1207C69E36 for ; Thu, 26 Feb 2026 13:02:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eu-iXXtv16PH for ; Thu, 26 Feb 2026 13:02:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136125; bh=L1WY3pDcL1KxopCYeUdcm9kmRkO9Dv3pMPwxA/EqRSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=t/2NQVuMgzryW+xnO69aHoFUkO3rSxW440boalSxtK99ckYzwQarMQOEFJpeoBbwY VDigvrayCgB/uM+C4Stc93JCftymVOSMyOnNTjsY44xEUs5EI7ma0AGjI7QN5pYt31 kRuMcosuYN6dh7O3pYAzo0wqyh2BJyKXQvb7RmXHsHc4Cdy5Z7VMY6NrapXzSWT3eg XDUH02Pd8e9iSYiF0YtvfRbmgcSw6G2DfRrocMmMiKuoL73POxVt/Nj5m7V9mz8MbK cq8j1eO2uhSV0e/sW6wRaQibjLUUdV2uiTmYzPlC/aw53hZ07pcnS+tLvfLV7XHX4Z JjWd1UkaQmbGA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0154569DAB for ; Thu, 26 Feb 2026 13:02:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136123; bh=v8zmP3JzaE35ShRC8IBxJZHbnGsrOvzy+faMixKqqoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rclIMgIRdQyTXaNz6+tfv7vhTg1kF4RW4wtXMjZ/yDAeJIBH98TayapksKaHFpGZB 4YxIqiMuILagB2RlCPj/UvbblFvbBqI+fZgrLdzNSdvb1TWnFlyliKSja/UJBSz6Av Nigm0T2/juogmgeclzockmKIjvpwg+ow8oqMddv6d+HsNLxfUKs08/95DXYIF/7pCT cr/KEQ39lOXWLA7nRNE2cdTYqMbONk/tsRYFmaV/SOpfSObPoTvG6WKj95vecxZ/jP h/GQsu6Cz4gExOvsfP7hqxqPplF9mXL1Pd1NSjHGMwpDLtk0N4R8g9odAkJrxjuycg OoZz8jhipEzyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2E93D69DAB; Thu, 26 Feb 2026 13:02:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id YJYyad8QMkfy; Thu, 26 Feb 2026 13:02:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136119; bh=RWdDEfuHvMud4mIPeN0Ibf3fPvALW1A2dVCh5Md9TGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnTWapt4lVrmecMfKi7EduKhzLb2R25GKcueiMTZGxJ/CJ/+QesREW4OPwFCjNfBw TPkDZM6RkSavEwKUiRBJAT3ix5c1ecsKyvwlpKB4hRnonI3s1hD9u9eXs8tjvqg07r rqxOSGS8Kh90tnqXGgudRuin0QxsRe8ScXV3+5R14Tif7SgSWiCGv9/kN8fTqNgCnh wH1okkibcSJ+2+MBrDSoJ7CzGJ54D6K2AeBmMUPj7F7aKCkhmdATg3cDmB6ryImVKd sv2eVD87kswUrA+q/RUa3O65c7P2BIWfbz7KMbfXHQybz7zFdXBUSM/LResX2Maq6e 99zWEi8o6bCwQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BEB7069D4A; Thu, 26 Feb 2026 13:01:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:14 -0700 Message-ID: <20260226200106.1727176-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LNQTOUXY2NKL2FJKS73SZJFNH6H77NHE X-Message-ID-Hash: LNQTOUXY2NKL2FJKS73SZJFNH6H77NHE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/32] patman: Add set-upstream command for series List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a 'series set-upstream' subcommand to allow setting or changing the upstream for an existing series. This uses the existing series_set_upstream() database method and follows the same pattern as the rename command. Usage: patman series -s set-upstream -u Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 4 ++++ tools/patman/control.py | 3 +++ tools/patman/cseries.py | 25 +++++++++++++++++++++++++ tools/patman/test_cseries.py | 17 +++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index f80323b7853..65b9dfab4bb 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -298,6 +298,10 @@ def add_series_subparser(subparsers): ren.add_argument('-N', '--new-name', help='New name for the series') series_subparsers.add_parser('rm') + + sup = series_subparsers.add_parser('set-upstream') + sup.add_argument('upstream_name', nargs='?', + help='Name of the upstream for this series') series_subparsers.add_parser('rm-version', aliases=ALIASES['rm-version']) scan = series_subparsers.add_parser('scan') diff --git a/tools/patman/control.py b/tools/patman/control.py index c6fede4305b..1a65dfc2cc6 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -191,6 +191,9 @@ def do_series(args, test_db=None, pwork=None, cser=None): cser.version_remove(args.series, args.version, dry_run=args.dry_run) elif args.subcmd == 'rename': cser.rename(args.series, args.new_name, dry_run=args.dry_run) + elif args.subcmd == 'set-upstream': + cser.set_upstream(args.series, args.upstream_name, + dry_run=args.dry_run) elif args.subcmd == 'scan': cser.scan(args.series, mark=args.mark, allow_unmarked=args.allow_unmarked, end=args.upstream, diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 6c918185387..246610215ed 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -770,6 +770,31 @@ class Cseries(cser_helper.CseriesHelper): if dry_run: tout.info('Dry run completed') + def set_upstream(self, series, ups, dry_run=False): + """Set the upstream for a series + + Args: + series (str): Name of series to use, or None to use current branch + ups (str): Name of the upstream to set + dry_run (bool): True to do a dry run + """ + if not ups: + raise ValueError('Please specify the upstream name') + ser, _ = self._parse_series_and_version(series, None) + if not ser.idnum: + raise ValueError(f"Series '{ser.name}' not found in database") + + self.db.series_set_upstream(ser.idnum, ups) + + if not dry_run: + self.commit() + else: + self.rollback() + + tout.notice(f"Set upstream for series '{ser.name}' to '{ups}'") + if dry_run: + tout.info('Dry run completed') + def scan(self, branch_name, mark=False, allow_unmarked=False, end=None, dry_run=False): """Scan a branch and make updates to the database if it has changed diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index e529d9fe61b..c6b90d5223d 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1909,6 +1909,23 @@ Tested-by: Mary Smith # yak slist = cser.db.series_get_dict() self.assertIsNone(slist['first'].upstream) + def test_series_set_upstream(self): + """Test setting upstream via the set-upstream command""" + cser = self.get_cser() + with terminal.capture(): + cser.add('first', '', allow_unmarked=True) + + self.db_close() + with terminal.capture() as (out, _): + self.run_args('series', '-s', 'first', 'set-upstream', + 'origin') + self.assertIn("Set upstream for series 'first' to 'origin'", + out.getvalue()) + + self.db_open() + slist = cser.db.series_get_dict() + self.assertEqual('origin', slist['first'].upstream) + def test_series_add_mark(self): """Test marking a cseries with Change-Id fields""" cser = self.get_cser() From patchwork Thu Feb 26 20:00:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136130; bh=dQNsGtO7kNY9dYiANmRinpdt6/ipLwqanlm6wH3OP3g=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XNGemrKOKs1s+BkYxMeAeGIezDWfvwTRwaepQRWfoRtDnGn6PthZncxzL087Og37X +OpqPvZ7Dl2EqLPIs1VN9HOpYpWZNVEoKq5sB9yKprBvy79763ordKbJ2K/MYSQRpc qfysuVKXBWcXUAmnhIx9Yn+4dMRd+SrrDi0Jie3YIZrk+ln6FHoQrZ3uYn7z3FACoq WQkXmLmpqvC7tRhUhry1QAThMQ3uKaJiiVUpLJjZMhtXpgkyQmizVWAx4695dTJBEm 4cZigy1Tg6Dcb/5yPPiRst3Tf32SL4r0bdmWDLjI+dHY4SIT/53rgCAkioemlwXgWR v0MQDp3ZZUm7w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0995E69D79 for ; Thu, 26 Feb 2026 13:02:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9l3Layt1qdxv for ; Thu, 26 Feb 2026 13:02:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136129; bh=dQNsGtO7kNY9dYiANmRinpdt6/ipLwqanlm6wH3OP3g=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=s5R5qU1OocZXnDYvcdMTrcB94XegPXJ5Kla0rel/u7d5L7F151nvCTVm07qqWw+We iePgC8xi5ZXOPsCFaWfrw+DjslCXpVQ6LARCFyPRcWVq73V/6A2/70yr8m+MiJGPjJ Zs1WWvAIMpbpoNjU2uGanWrZy3ZzdyVFatxURuE0j0FjEmT7MUH1qG3QjAzGNPN7gX 6dNusJ0p9zzyOi5Pye5WwLmVwpUXgCteqzCcOYBaH6tHno3uTDQ0Wwoff+ivajodJb nEd9cvIt3yz2udrJ5rOXXe4seNv6XVvzSMtpNfZRHAn5g5rpBk+UAItdBSAGamv/k7 x3jH9uBFLd04g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EA53269DAB for ; Thu, 26 Feb 2026 13:02:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136127; bh=qofrSQMNKwGi2GKxIqR2Z7cZzpGuya2XOmSKGZA4BHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OB2KgY1hQenrVrPw2Gq1UKSTlw9FEhL7jYily+GO0CLe1BImGgbazAOd0MJGdfX+h SYCQsJZ48/6Zs673mUwB+OdfOpi1POLk1po5gmHox+BihMyCfhZH3qHyIgDUPAIiOT MODiRpiavCpv/dbxAl/lWtRzu9cwFFMnMySdadp1ZaXhjXkfE/yqdBkS4+FLIS698y DnSfbpUdEnV0EjsccMLPLeK/+KV8VIYw+d4KX7NY1JfuLwia71/UNQR2znwMMbeG0H sU/3z1TumJwW9yIQ+OSumkSCaVuczn3MtyCZXGgfYfToDpW5mT+KnYlQtYHrIynf8m me+li1J2BQwBg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 87F8B69DAB; Thu, 26 Feb 2026 13:02:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2O2X7Im-q7NK; Thu, 26 Feb 2026 13:02:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136123; bh=pwT9VRkypmvCiX5OK70K/in+uizZqq3M7/OqiJGHJYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lDPykFgla+mHk8IE7qwKCPbBnYEe80MK+NM93we9wpj6zbRfYPP0NmQz+LwJvcrpg reCHe2c30skB4Zi9Ood0tG6nD9E8ttar5VfVMzZOocO9TAnrPK2qr8u1r6bRQnEE29 uIgC5fvvLTzCne+bSYrGE8G5KJrd2bTJG1mCASv2p8pRrioL8kF4ZikK/hQNka6FJe pnTpeGwV5lYh5BK35GqsH60y5wSTEtWCzqK9eHj7sNgGH35kNTmx45HUJ+DosmUkKA W54jX+N7LZRWSFOVOCAmjAsJ2W+hw2s7Ck6sbZgy2HWnMZvO344hRJ37G0wU29gM+J fZcvGpKyPly9Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6F66469D4A; Thu, 26 Feb 2026 13:02:03 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:15 -0700 Message-ID: <20260226200106.1727176-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3KRW2ZFMI5MRBS7RX22KK6757DDXHUOR X-Message-ID-Hash: 3KRW2ZFMI5MRBS7RX22KK6757DDXHUOR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/32] patman: Associate patchwork projects with upstreams List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Each upstream typically has its own patchwork project. Add an upstream column to the patchwork table (schema v5) so each upstream can have its own project configuration. Rename the table from 'settings' to 'patchwork' to better reflect its purpose. During migration, any existing row is associated with the default upstream. The patchwork_update() and patchwork_get() methods accept an optional upstream parameter to store and retrieve per-upstream project configuration. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 4 +-- tools/patman/database.py | 49 +++++++++++++++++------------ tools/patman/test_cseries.py | 60 ++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 21 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 246610215ed..5d4a9592de9 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -659,7 +659,7 @@ class Cseries(cser_helper.CseriesHelper): tout.detail(f'Name match: ID {proj_id}') if not proj_id: raise ValueError(f"Unknown project name '{name}'") - self.db.settings_update(name, proj_id, link_name) + self.db.patchwork_update(name, proj_id, link_name) self.commit() if not quiet: tout.notice(f"Project '{name}' patchwork-ID {proj_id} " @@ -674,7 +674,7 @@ class Cseries(cser_helper.CseriesHelper): proj_id (int): Patchworks project ID for this project link_name (str): Patchwork's link-name for the project """ - return self.db.settings_get() + return self.db.patchwork_get() def remove(self, name, dry_run=False): """Remove a series from the database diff --git a/tools/patman/database.py b/tools/patman/database.py index 2bd225e4deb..22f21ce715f 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -165,12 +165,12 @@ class Database: # pylint:disable=R0904 self.cur.execute('ALTER TABLE ser_ver ADD COLUMN archive_tag') def _migrate_to_v5(self): - """Add upstream support to series, settings and upstream tables + """Add upstream support to series, patchwork and upstream tables - Add upstream column to series table - - Recreate settings table without UNIQUE constraint on name, adding - an upstream column (since the same project can have multiple - remotes) + - Rename and recreate patchwork table (formerly 'settings') without + UNIQUE constraint on name, adding an upstream column (since the + same project can have multiple remotes) - Add patchwork_url, identity, series_to, no_maintainers and no_tags columns to upstream table - Add desc column to ser_ver table @@ -178,17 +178,17 @@ class Database: # pylint:disable=R0904 self.cur.execute('ALTER TABLE series ADD COLUMN upstream') self.cur.execute( - 'CREATE TABLE settings_new ' + 'CREATE TABLE patchwork_new ' '(name, proj_id INT, link_name, upstream)') self.cur.execute( - 'INSERT INTO settings_new SELECT name, proj_id, link_name, NULL ' + 'INSERT INTO patchwork_new SELECT name, proj_id, link_name, NULL ' 'FROM settings') self.cur.execute('DROP TABLE settings') - self.cur.execute('ALTER TABLE settings_new RENAME TO settings') + self.cur.execute('ALTER TABLE patchwork_new RENAME TO patchwork') default_ups = self.upstream_get_default() if default_ups: self.cur.execute( - 'UPDATE settings SET upstream = ?', (default_ups,)) + 'UPDATE patchwork SET upstream = ?', (default_ups,)) self.cur.execute('ALTER TABLE upstream ADD COLUMN patchwork_url') self.cur.execute('ALTER TABLE upstream ADD COLUMN identity') @@ -867,32 +867,43 @@ class Database: # pylint:disable=R0904 udict[name] = url, is_default return udict - # settings functions + # patchwork functions - def settings_update(self, name, proj_id, link_name): - """Set the patchwork settings of the project + def patchwork_update(self, name, proj_id, link_name, ups=None): + """Set the patchwork project details for an upstream Args: name (str): Name of the project to use in patchwork proj_id (int): Project ID for the project link_name (str): Link name for the project + ups (str or None): Upstream name to associate with, or None """ - self.execute('DELETE FROM settings') self.execute( - 'INSERT INTO settings (name, proj_id, link_name) ' - 'VALUES (?, ?, ?)', (name, proj_id, link_name)) + 'DELETE FROM patchwork WHERE upstream IS ?', (ups,)) + self.execute( + 'INSERT INTO patchwork (name, proj_id, link_name, upstream) ' + 'VALUES (?, ?, ?, ?)', (name, proj_id, link_name, ups)) + + def patchwork_get(self, ups=None): + """Get the patchwork project details for an upstream - def settings_get(self): - """Get the patchwork settings of the project + Args: + ups (str or None): Upstream name to look up, or None for any Returns: - tuple or None if there are no settings: + tuple or None if there is no project set: name (str): Project name, e.g. 'U-Boot' proj_id (int): Patchworks project ID for this project link_name (str): Patchwork's link-name for the project """ - res = self.execute("SELECT name, proj_id, link_name FROM settings") + if ups is not None: + res = self.execute( + 'SELECT name, proj_id, link_name FROM patchwork ' + 'WHERE upstream = ?', (ups,)) + else: + res = self.execute( + 'SELECT name, proj_id, link_name FROM patchwork') recs = res.fetchall() - if len(recs) != 1: + if not recs: return None return recs[0] diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index c6b90d5223d..0922c3e57f5 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -2502,6 +2502,66 @@ Tested-by: Mary Smith # yak f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} link-name 'uboot'", out.getvalue().strip()) + def test_patchwork_upstream(self): + """Test patchwork project with upstream association""" + cser = self.get_cser() + + # Add two upstreams + cser.db.upstream_add('us', 'https://us.example.com') + cser.db.upstream_add('ci', 'https://ci.example.com') + cser.db.commit() + + # Set project for a specific upstream + cser.db.patchwork_update('U-Boot', 6, 'uboot', 'us') + cser.db.commit() + + # Look up by upstream + info = cser.db.patchwork_get('us') + self.assertEqual(('U-Boot', 6, 'uboot'), info) + + # Different upstream has no project + self.assertIsNone(cser.db.patchwork_get('ci')) + + # No upstream arg returns any match + info = cser.db.patchwork_get() + self.assertEqual(('U-Boot', 6, 'uboot'), info) + + # Set a different project for ci + cser.db.patchwork_update('Linux', 10, 'linux', 'ci') + cser.db.commit() + + self.assertEqual(('Linux', 10, 'linux'), cser.db.patchwork_get('ci')) + self.assertEqual(('U-Boot', 6, 'uboot'), cser.db.patchwork_get('us')) + + def test_migrate_patchwork_upstream(self): + """Test that migrating to v5 renames settings to patchwork""" + db = database.Database(f'{self.tmpdir}/.patman3.db') + with terminal.capture(): + db.open_it() + + # Create a v4 database with an upstream and a patchwork row + with terminal.capture(): + db.migrate_to(4) + db.execute( + "INSERT INTO upstream (name, url, is_default) " + "VALUES ('us', 'https://us.example.com', 1)") + db.execute( + "INSERT INTO settings (name, proj_id, link_name) " + "VALUES ('U-Boot', 6, 'uboot')") + db.commit() + + # Migrate to v5 + with terminal.capture(): + db.migrate_to(5) + + # The existing row should now be in 'patchwork' with the default upstream + res = db.execute( + 'SELECT name, proj_id, link_name, upstream FROM patchwork') + recs = res.fetchall() + self.assertEqual(1, len(recs)) + self.assertEqual(('U-Boot', 6, 'uboot', 'us'), recs[0]) + db.close() + def check_series_list_patches(self): """Test listing the patches for a series""" cser = self.get_cser() From patchwork Thu Feb 26 20:00:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1947 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136134; bh=x+9SFw3xYG7UGQoPCXYurvrH7k5X6fmZJkx+Fk0cBCo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=no82IcNY3R4hu6ufcq3gMDrINgwwWg+pUErL2wdKukFCtnQKJ7hPogflcB7caI4YA 5UwCSeLuJwakBrxe3YCLVvdVwzLRSo6GOHbHzwmIky7/bl937RuvgmHUzo9qbPpu12 TJkSGfkF0ver6jLn+c+PxXbPSYM2kAUZ0OrNntV74qKZb283mhKoDKxoFi23BqBF9Z W8OUzRGWHNLAVz9gv7U1AEuWbDIgtT4Os1ncxN6MNDBgPG5NzP1kx972yiC8EKxob1 dPCs/hdP1b4HCYvcI49aYI6s0df+bzrkjugASmM8Ngp0YJaRjuaPCbSs8QGjxpjvWe ISwiSg+ZMvWSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9DB1C69E3A for ; Thu, 26 Feb 2026 13:02:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rUItrxwTsc9z for ; Thu, 26 Feb 2026 13:02:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136134; bh=x+9SFw3xYG7UGQoPCXYurvrH7k5X6fmZJkx+Fk0cBCo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=no82IcNY3R4hu6ufcq3gMDrINgwwWg+pUErL2wdKukFCtnQKJ7hPogflcB7caI4YA 5UwCSeLuJwakBrxe3YCLVvdVwzLRSo6GOHbHzwmIky7/bl937RuvgmHUzo9qbPpu12 TJkSGfkF0ver6jLn+c+PxXbPSYM2kAUZ0OrNntV74qKZb283mhKoDKxoFi23BqBF9Z W8OUzRGWHNLAVz9gv7U1AEuWbDIgtT4Os1ncxN6MNDBgPG5NzP1kx972yiC8EKxob1 dPCs/hdP1b4HCYvcI49aYI6s0df+bzrkjugASmM8Ngp0YJaRjuaPCbSs8QGjxpjvWe ISwiSg+ZMvWSg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8398169D79 for ; Thu, 26 Feb 2026 13:02:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136132; bh=ovce6l1KylloAWXBiZ81RP9AFtfg3SYJvZZHNqlNofk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/X8aC1jfeJbE49jvPSLaYRMpRT4kNuASuNX/Ao61ve9OG/8KC02kMEdF2+77X8w3 qa9KScfh6ZtY8DtgDXrxHL0Rif3nph4C/cdYTNnw7YbfKMzjOxxjtColTPiYXpcan3 oi7Po8A6Tpz3rWSJV5yyQbZQRL6euIxk0KQHOq6Smt4PJSGQkDIo17FrCRGEDLaj9r XK0M588OMvDekOkn+qFdgBJ79egHpNaxAfzkQlJZXUZCzNuOh4okXtNdPHPG48z2YN FCIC+ZVmwJ5FWM0DBNnWs8D584UG5Q4D6yaiqAsZKB8HUEr17OUzHgIyqzSHO+huQ2 0Ig0FZegAcstw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6076769E3A; Thu, 26 Feb 2026 13:02:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id l0qlVT2_45RP; Thu, 26 Feb 2026 13:02:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136128; bh=SZp0p7/YW12YIr2RKa9/jBTH5HTyHC/zOAhkmNol8qE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlEgFdpy/ugEDk5dMgLtoKIemXwOjy00d5zlj3zgdxqdNqwS4GdMwk2fn5zRkEuKv 83HKUkH/cwKiTf12hM29tC0KFBgX/z5m8cOUwPZZrrYkRfZsUuVyuKxnds5kz9KAiw vyDY5vBBfhfzK9YB2YnQb/B9LV70Fjet3a/Gbz04z/yqvznL++3rPZlG9wk+CgnK9h C+pHnZMQoxiR7ay+GPI0WsrViyNoIilzFv896QijzdkAYOF5FQ01lro/hmmn7JPDTS e8xubiLHvsRUWTzg36d3dO+xx2xMcAVb2Q91sf9tsvQBW5urEP5Ih0d2sob4jMSpBq sljOkWZr/xDUw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CAF9D69D4A; Thu, 26 Feb 2026 13:02:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:16 -0700 Message-ID: <20260226200106.1727176-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SR52L76COIFSH2RAS7Q3CYHLCAMYRAKF X-Message-ID-Hash: SR52L76COIFSH2RAS7Q3CYHLCAMYRAKF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/32] patman: Add upstream parameter to project_set() and project_get() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Allow project_set() and project_get() to accept an upstream name so that each upstream can be associated with a different patchwork project. When no upstream is specified, the existing behaviour is preserved. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 5d4a9592de9..56adcc5b4cd 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -637,12 +637,13 @@ class Cseries(cser_helper.CseriesHelper): 'subjects which mismatch their patches and need to be ' 'scanned') - def project_set(self, pwork, name, quiet=False): - """Set the name of the project + def project_set(self, pwork, name, ups=None, quiet=False): + """Set the name of the project for an upstream Args: pwork (Patchwork): Patchwork object to use name (str): Name of the project to use in patchwork + ups (str or None): Upstream name to associate with quiet (bool): True to skip writing the message """ tout.detail(f"Patchwork URL '{pwork.url}': finding name '{name}'") @@ -659,14 +660,20 @@ class Cseries(cser_helper.CseriesHelper): tout.detail(f'Name match: ID {proj_id}') if not proj_id: raise ValueError(f"Unknown project name '{name}'") - self.db.patchwork_update(name, proj_id, link_name) + self.db.patchwork_update(name, proj_id, link_name, ups) self.commit() if not quiet: - tout.notice(f"Project '{name}' patchwork-ID {proj_id} " - f"link-name '{link_name}'") + msg = f"Project '{name}' patchwork-ID {proj_id} " + msg += f"link-name '{link_name}'" + if ups: + msg += f" upstream '{ups}'" + tout.notice(msg) + + def project_get(self, ups=None): + """Get the details of the project for an upstream - def project_get(self): - """Get the details of the project + Args: + ups (str or None): Upstream name to look up, or None for any Returns: tuple or None if there are no settings: @@ -674,7 +681,7 @@ class Cseries(cser_helper.CseriesHelper): proj_id (int): Patchworks project ID for this project link_name (str): Patchwork's link-name for the project """ - return self.db.patchwork_get() + return self.db.patchwork_get(ups) def remove(self, name, dry_run=False): """Remove a series from the database From patchwork Thu Feb 26 20:00:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1948 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136137; bh=udcvQOJok/WGoDBknxWvJDbwH2YBDLNYjwgmefh/jV4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=t4Og8hi2S+pWs7Fql0N4+7YkaXYFSIFQqkZbVc48JkZGDozMiY5eJadwzv9svbbvN DG9NKoo2+oXUQilrJ6zzWgQDZT0i8fzzSclsDcgssaMJzQRX5k82rJJaIfR5kLfRNA kyDK9lRHryV3gWu/5zg1NEZGGT6msqrUast4m+5XQTzmQkJYvlOD7k0D6AQev655V4 BUYFGuKhnfCb4m88K+TXyVCYIeMVL1XBIeBpwXATdTuUS/bmBYLCN4w131A+jQ+e3V YOhU26QkVfMmTDXVZ/E9sAmJhvwb6a2FxZSC8BmRG3MFHLTQxxPfUd+Ns3Ll09Vldt f2wPJn3tnFeoA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0463C69E39 for ; Thu, 26 Feb 2026 13:02:17 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AfwtSBuYNRIG for ; Thu, 26 Feb 2026 13:02:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136136; bh=udcvQOJok/WGoDBknxWvJDbwH2YBDLNYjwgmefh/jV4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GNY0qLctFOvkK0dXCJazyyhPl2423bCjQBTqzIc3GtOJcaq95RV/ygoEWyvLnRB3h w+dNmz2E1hm8t8rlIxwAPGA/EMJIernLu/mfdayhDwtaP+drDoNrXb7EaDQx2ZjBXV j0S8H4denmExje/vu5J8uy/xCcHxoXUslNYeRdJ+PrtBumJx3Ae0JEU2uXNeE8MhM2 +1/oZ5vEJ6zs6ADz0929HxQO2uuhpmj7wx+zFvfMSeBlAiGL8KPvQfvu4QMJR0LfQI HDEj1Kcsiwp+FgK9enXaMUzHEL5JRfvzz7tUasQi3fZQ3hquiPrUifG+sygEkPekhq vjxm6OSDOa03g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8C85D69E3A for ; Thu, 26 Feb 2026 13:02:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136132; bh=IGY7mCYaHwjEjzVwD63Xx1sU4uU+VwbpcyzGIpxL6K0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPU71Oy8DPxzoz46ImlTL6x/VdGFTCIPHMGpQyykDbWB6Akdnkmx7w9yNeK9UQfcd s6FrTRXJn2n1fk0BfVmr1DrF4sRcQRNWr0bZ6Z1YSYPLRFCaYxMrmMHUbwq330oHQf ho0mjE7tsQUOef4kjCgsK0nhxac2aj4Piph3mqqEwVT07gQMfsBIr4N5gbmJTWYPyQ yHOC76gWmdNB8TgsUDzfbSYcbLYvEWx424Gy00Z6Oyz2e0Zzjo8cjhqBHZxcfHMM1G qDijPBI0MbtUykkYz73YfQw+fmK7e/aNw2RJUzEldpyh/GaWKsRvBoXdxFJ+XiBkA2 mwA7VW1pz+orA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E775B69D79; Thu, 26 Feb 2026 13:02:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 3tATFtodWKZt; Thu, 26 Feb 2026 13:02:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136132; bh=CfQ8LmU16hL6LngrIm/QOGO+pvFo2piP6ON2RmBiL9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXYcH19+sh6bk1eOrVuRh36iX3xAde9xZdiLmcNOgvBjT+arVzq6fSZCzhgqPbTv4 R1uMVgtOJflIUChlF2N8mvrA4POr6FZUfHwAWA88hQgGvf5GSo0Hh1CEM0z5UT4ItP QDTzvOu3sVBnuzWQmnd3hVFV4Z437eIa/zmTC0+EgwfMKT8sK4sZyNE8booLiorInv 6HI7zhLQxdgwg1dZgzU6IQCGOig4oqjCrWchx+0osV6sW231dkNr9DmQGIIekVbDSD ToFMsrFMwWfUA75ssguQwybYJ4MPdeWSzKQ6Jz8W2JSkRwV8KdM1WFeR7pdMd9OfuN 1zkdcF3PMauKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7736869DAB; Thu, 26 Feb 2026 13:02:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:17 -0700 Message-ID: <20260226200106.1727176-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VCZV5R6XMB6TUQXFCU7SAKGBI26DR4RI X-Message-ID-Hash: VCZV5R6XMB6TUQXFCU7SAKGBI26DR4RI X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/32] patman: Add get_series_upstream() helper List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a method to look up the upstream for a series by name. If no name is given, use the current branch. This is needed so that patchwork commands can find the correct project for the series being operated on. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index 74bccfcfbc6..a60e02878a5 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -426,6 +426,22 @@ class CseriesHelper: self.db.pcommit_add_list(svid, to_add) + def get_series_upstream(self, name): + """Get the upstream for a series + + Args: + name (str): Name of series, or None to use current branch + + Return: + str or None: Upstream name, or None if not found + """ + if not name: + name = gitutil.get_branch() + ser = self.get_series_by_name(name) + if ser: + return ser.upstream + return None + def get_series_by_name(self, name, include_archived=False): """Get a Series object from the database by name From patchwork Thu Feb 26 20:00:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1949 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136141; bh=55ABauCDpo0+545aggdEEqX4keObUX0ezNtd5QIgenQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sI/2wAGWLYqSvbN2S0RV92e6k2cmQ5+c5AOm50gSWkCDTrWGGUrzdLmFPjdF8okJM jtwD7Qw9H5v+g9JXxjQZsKpj2hohhp3zN8CQU7QCc4ixj4nCtnFuI0d7agxpOq0R/H yCJaFqq75WL89v6S8/1/S8QYxY2K1Jbk9rlkbOVTVCb1ONHzbjSByqwWvuZutpwdCd WQL65fJgwx6e+lS+oIGBA6lLc3zVyjl4ItgFr7/z6FRNXrWYKElvERopIOMw2OLMkL pbpzyJcReyrgZYyEh3jRlLRHVECtAxeVZvs3Z80wfoMjkGQVs/YKJ4HLFo01yP+m6q vF3h6fRXCumkw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1CB5E69E3A for ; Thu, 26 Feb 2026 13:02:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id F5apme657EB3 for ; Thu, 26 Feb 2026 13:02:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136141; bh=55ABauCDpo0+545aggdEEqX4keObUX0ezNtd5QIgenQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sI/2wAGWLYqSvbN2S0RV92e6k2cmQ5+c5AOm50gSWkCDTrWGGUrzdLmFPjdF8okJM jtwD7Qw9H5v+g9JXxjQZsKpj2hohhp3zN8CQU7QCc4ixj4nCtnFuI0d7agxpOq0R/H yCJaFqq75WL89v6S8/1/S8QYxY2K1Jbk9rlkbOVTVCb1ONHzbjSByqwWvuZutpwdCd WQL65fJgwx6e+lS+oIGBA6lLc3zVyjl4ItgFr7/z6FRNXrWYKElvERopIOMw2OLMkL pbpzyJcReyrgZYyEh3jRlLRHVECtAxeVZvs3Z80wfoMjkGQVs/YKJ4HLFo01yP+m6q vF3h6fRXCumkw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0CF6069DAB for ; Thu, 26 Feb 2026 13:02:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136139; bh=Fz8PA4aZRLqGBicd1PhYZqcskaRuELpbzXiZSi3JvfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVzL4w7aSMdX/u2LVOSDuRa3qmNP+yeNIHFwJvjlmCUoTQX/hDsEN7yZplb2N2NXv XazmiSiG0wYNlLvh3xU/d0hp844rwEslh8xtkX7kY8KKpDomcrBrpvtJdV9iVJi88e fPQ2xrdTEZuU0J57gjbD4JBTXzcnt60Oshd6YiD5x0XWMQfRtZNzajd0NkUQw4MRvK QVkLqDt2upUAIdykd05BIvSf9/3GQNvy/oByFnvpz06JFM5A/8TALMG5mE9o8CDNzW w0Kk0da3GSbGPCQ2TMhBDizNE8Z1Eg+7ShArcy+vfU5bB9KRQsXP/VYHnQXek8TE9C 10qwEBMSa+z+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 485F269D79; Thu, 26 Feb 2026 13:02:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id zS56lnb2ZDig; Thu, 26 Feb 2026 13:02:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136133; bh=19vFT/55GzuzZhgn6fa2PkGxh4no79wUCm88KH8kaCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XCEBD/ht0oUw+Lb6mOrH3uAdDW2KAOuGL95xzZd4zuWgf6emUh2pM3bvh1kvlnLgp +ST9v1zFSl3Ppwl8t3Wr8u2su/ChoYI1WliPOPnWMmwU4aSn0gUMeJ68inm3qIkP9K FVygf801HoSGPPyqdKQDmLj+jNJPm8CrmHWN+rLb5ayv4jXsx3Sh/wz8OivJr39Ryx XldbHqkTYAcSoukOt0UXrZCSZ4san5snTBywwxeMTryxiPfJ9lcaf9UsbuotSrWPxP k7vn8JaD3g3n71xHYFOWMNFihJnrnJ3HTvIDlC2L1BRaB7vXkgs/Ns6teZS8oEgrao mzddin71F3ntQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 37F5469DAB; Thu, 26 Feb 2026 13:02:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:18 -0700 Message-ID: <20260226200106.1727176-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WHRUGCBXWD4DIKGUZ3J2CMES7ZMB2ALL X-Message-ID-Hash: WHRUGCBXWD4DIKGUZ3J2CMES7ZMB2ALL X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/32] patman: Wire up per-upstream patchwork project in commands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add -u/--upstream-name to set-project and get-project so the user can specify which upstream a project belongs to. In do_series(), look up the series' upstream and use it to find the matching patchwork project, falling back to any configured project if there is no upstream-specific one. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 8 +++++++- tools/patman/control.py | 26 +++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 65b9dfab4bb..74571fd7220 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -159,10 +159,16 @@ def add_patchwork_subparser(subparsers): ['set-project', 'U-Boot'], ] patchwork_subparsers = patchwork.add_subparsers(dest='subcmd') - patchwork_subparsers.add_parser('get-project') + gproj = patchwork_subparsers.add_parser('get-project') + gproj.add_argument( + '-u', '--upstream-name', + help='Upstream to get the project for') uset = patchwork_subparsers.add_parser('set-project') uset.add_argument( 'project_name', help="Patchwork project name, e.g. 'U-Boot'") + uset.add_argument( + '-u', '--upstream-name', + help='Upstream to associate this project with') return patchwork diff --git a/tools/patman/control.py b/tools/patman/control.py index 1a65dfc2cc6..191cfc134d3 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -135,11 +135,15 @@ def do_series(args, test_db=None, pwork=None, cser=None): if args.subcmd in needs_patchwork: if not pwork: pwork = Patchwork(args.patchwork_url) - proj = cser.project_get() + ups = cser.get_series_upstream(args.series) + proj = cser.project_get(ups) + if not proj: + proj = cser.project_get() if not proj: raise ValueError( - "Please set project ID with 'patman patchwork set-project'") - _, proj_id, link_name = cser.project_get() + "Please set project ID with " + "'patman patchwork set-project'") + _, proj_id, link_name = proj pwork.project_set(proj_id, link_name) elif pwork and pwork is not True: raise ValueError( @@ -270,13 +274,21 @@ def patchwork(args, test_db=None, pwork=None): if args.subcmd == 'set-project': if not pwork: pwork = Patchwork(args.patchwork_url) - cser.project_set(pwork, args.project_name) + cser.project_set(pwork, args.project_name, + ups=args.upstream_name) elif args.subcmd == 'get-project': - info = cser.project_get() + ups = args.upstream_name + info = cser.project_get(ups) if not info: - raise ValueError("Project has not been set; use 'patman patchwork set-project'") + raise ValueError( + "Project has not been set; use " + "'patman patchwork set-project'") name, pwid, link_name = info - print(f"Project '{name}' patchwork-ID {pwid} link-name '{link_name}'") + msg = (f"Project '{name}' patchwork-ID {pwid} " + f"link-name '{link_name}'") + if ups: + msg += f" upstream '{ups}'" + print(msg) else: raise ValueError(f"Unknown patchwork subcommand '{args.subcmd}'") finally: From patchwork Thu Feb 26 20:00:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136145; bh=4mxzNqk7LgBnZCE0sehPYYiw0NvprVbcJxDJGs0faQQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gZGE6qtcQCyidKpAxZRc+vhmDvlzut/7htz5DjRegnwXDkppjN9uUeEJdmwwlxtX1 Jo1lbqL9mYIrrMaTkCjyw8bbxwyQ1Bdjj0NESfzS1MZ3UhNSksQ01hZEt+nigwfpk/ xY1PqChczbJ1n5L37CLQncDzScD+51NcjnCTUTz7AGjVn7Is7//zUjUsQuaQf8XSBS sdPpIJsRlVrEr8Pcwo/D8L2DLVZtfrD60gMZC0L9xaFrGF7SMwllohHZ4H70SnRlwQ yDBHP4+O73Np3W/xEnrUQP/65TvP9hv6o2ZbJiLb7NLGF7zVSt13Ju/KAgZ+T9idKj rbp55YDMx/B6Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CBAE269E39 for ; Thu, 26 Feb 2026 13:02:25 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WNz_j8WOHf-B for ; Thu, 26 Feb 2026 13:02:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136145; bh=4mxzNqk7LgBnZCE0sehPYYiw0NvprVbcJxDJGs0faQQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gZGE6qtcQCyidKpAxZRc+vhmDvlzut/7htz5DjRegnwXDkppjN9uUeEJdmwwlxtX1 Jo1lbqL9mYIrrMaTkCjyw8bbxwyQ1Bdjj0NESfzS1MZ3UhNSksQ01hZEt+nigwfpk/ xY1PqChczbJ1n5L37CLQncDzScD+51NcjnCTUTz7AGjVn7Is7//zUjUsQuaQf8XSBS sdPpIJsRlVrEr8Pcwo/D8L2DLVZtfrD60gMZC0L9xaFrGF7SMwllohHZ4H70SnRlwQ yDBHP4+O73Np3W/xEnrUQP/65TvP9hv6o2ZbJiLb7NLGF7zVSt13Ju/KAgZ+T9idKj rbp55YDMx/B6Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B9F0C69DAB for ; Thu, 26 Feb 2026 13:02:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136143; bh=zeHOo4n1H14vlP9XxCm10Py1GxjSdgcL0jTYKIuUZBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2Cz4tgGydg00y39ToiBeox54h3ZPyLi3dyPLaUEfXqn1OFfPeOVweMwlj4DedDWf S5KW/dd//acohvSQ01SuVjeNZwP6SSB/uFevORs9EqSj00OFQc6LacH+PUoLJYkmpS NeTXRMZMuBIwMYqAy5IzINe1qRCLLySdx0jONPqnGZtdf4s9v3XHrzn/gyLx9gn+rP rmPMGKebk39EGEt2RVHPWltze1FkPNa86h3I7TKkfW6aRNjrzhlaV65ZpuGnXhB/VO 75XgIov2fNM1PTQ+p3Ou8R2W9ETH1AUkqfLIFt+paQEcoF8tvR00fFZI7islfFnJCu xeU1QOHSdOuXA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7A23D69E39; Thu, 26 Feb 2026 13:02:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id nh1xHLBHM0l8; Thu, 26 Feb 2026 13:02:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136137; bh=zpNqiWUsaFwrrLHDv9iJGKeAUixuDYE9Jth1BvECTJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ThJtbWGzZnH0pw3TxG/DVJACb6/aU6G+ElxzDUjhLlwqA6U0RIcMHklLy2B0il+Yl uVKR731Mtli3JnIBmmSnuD9vDOcDWtJvRy6M39QXyYPATnXmfMvkyDVhxQxtr24vpQ WzSCE1tVDn2HHzdOMnqxytbCgV4rwJ8hyDgjmmoSAbIzceREQDcyp5y2u0JAztnoLJ CgtvD/DINWtpZhAJ/JYQKhJ+naveiNYrCf41cDLIT35dJa8fUtZXYmsugj0QaxLqD9 T8+6z7B9xgvVfPGyQzJmgmSSUtTnFS6iU+5d0yz1a8VnS+kXS4eeAzh5BTgjTpaqr+ YMBEvO7CLeXDQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7ADFF69E35; Thu, 26 Feb 2026 13:02:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:19 -0700 Message-ID: <20260226200106.1727176-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HNEYQ5P576JJBFOMETTB6RJWB545LPY3 X-Message-ID-Hash: HNEYQ5P576JJBFOMETTB6RJWB545LPY3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/32] patman: Add patchwork list command List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a 'patchwork list' (or 'pw list') command to show all configured patchwork projects and which upstream each is associated with. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 1 + tools/patman/control.py | 2 ++ tools/patman/cseries.py | 13 +++++++++++++ tools/patman/database.py | 15 +++++++++++++++ tools/patman/test_cseries.py | 26 ++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 74571fd7220..f08287641dd 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -169,6 +169,7 @@ def add_patchwork_subparser(subparsers): uset.add_argument( '-u', '--upstream-name', help='Upstream to associate this project with') + patchwork_subparsers.add_parser('list') return patchwork diff --git a/tools/patman/control.py b/tools/patman/control.py index 191cfc134d3..bd9e0f8b9bd 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -289,6 +289,8 @@ def patchwork(args, test_db=None, pwork=None): if ups: msg += f" upstream '{ups}'" print(msg) + elif args.subcmd == 'list': + cser.project_list() else: raise ValueError(f"Unknown patchwork subcommand '{args.subcmd}'") finally: diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 56adcc5b4cd..fdf48a4eabd 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -683,6 +683,19 @@ class Cseries(cser_helper.CseriesHelper): """ return self.db.patchwork_get(ups) + def project_list(self): + """List all patchwork project configurations""" + settings = self.db.patchwork_get_list() + if not settings: + print('No patchwork projects configured') + return + print(f"{'Project':20} {'ID':>4} {'Link name':15} Upstream") + border = f"{'-' * 20} {'-' * 4} {'-' * 15} {'-' * 15}" + print(border) + for name, proj_id, link_name, ups in settings: + print(f'{name:20} {proj_id:4} {link_name:15} {ups or ""}') + print(border) + def remove(self, name, dry_run=False): """Remove a series from the database diff --git a/tools/patman/database.py b/tools/patman/database.py index 22f21ce715f..396cf52aa48 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -884,6 +884,21 @@ class Database: # pylint:disable=R0904 'INSERT INTO patchwork (name, proj_id, link_name, upstream) ' 'VALUES (?, ?, ?, ?)', (name, proj_id, link_name, ups)) + def patchwork_get_list(self): + """Get all patchwork project configurations + + Returns: + list of tuple: + name (str): Project name, e.g. 'U-Boot' + proj_id (int): Patchworks project ID for this project + link_name (str): Patchwork's link-name for the project + upstream (str or None): Upstream name + """ + res = self.execute( + 'SELECT name, proj_id, link_name, upstream FROM patchwork ' + 'ORDER BY upstream') + return res.fetchall() + def patchwork_get(self, ups=None): """Get the patchwork project details for an upstream diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 0922c3e57f5..f21fda8d2fa 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -2502,6 +2502,32 @@ Tested-by: Mary Smith # yak f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} link-name 'uboot'", out.getvalue().strip()) + def test_patchwork_list(self): + """Test listing patchwork project configurations""" + cser = self.get_cser() + + # No projects configured + with terminal.capture() as (out, _): + cser.project_list() + self.assertEqual('No patchwork projects configured', + out.getvalue().strip()) + + # Add projects for two upstreams + cser.db.upstream_add('us', 'https://us.example.com') + cser.db.upstream_add('ci', 'https://ci.example.com') + cser.db.patchwork_update('U-Boot', 6, 'uboot', 'us') + cser.db.patchwork_update('Linux', 10, 'linux', 'ci') + cser.db.commit() + + with terminal.capture() as (out, _): + cser.project_list() + lines = out.getvalue().splitlines() + self.assertEqual(5, len(lines)) + self.assertIn('Linux', lines[2]) + self.assertIn('ci', lines[2]) + self.assertIn('U-Boot', lines[3]) + self.assertIn('us', lines[3]) + def test_patchwork_upstream(self): """Test patchwork project with upstream association""" cser = self.get_cser() From patchwork Thu Feb 26 20:00:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1951 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136148; bh=fbDXpdDdJlVsOiiwxXWNfEHmHHkj6DEGpuh3LRpZ6dc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nRQ1uQ6xpP/ReHTD9P8tk8txRcDT1HXX+2y8EF4aWPhtvHD/M99vpYywsxP13tSoZ u6rpVO7quAlRjc4132zJuhz3Pt8z2YUiDV5kaXP+PZS1ip9TpTATxCsFfE1BO1gmcp DOWij5nIGAH+KIe52D9R1oKQS+tXPqejb9E1syG37u4niieJT1ZqwJbyBnFyzCPcGl 6PyERHD/KJ1iQpJgR20p97RVkyg96gQOzggRtOaEmEvO+MqVQbTZAcLnWUaL5bJ1kq QFsAen7xQtHaFQ7rWNf7NVcKIUjTBqcDNLod2HfGZC+S7TiHhWZO7KsUTCyTyfNxUi mu3Q0kNSop7sA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4804369E3F for ; Thu, 26 Feb 2026 13:02:28 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6aLS7F6h9Vvi for ; Thu, 26 Feb 2026 13:02:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136146; bh=fbDXpdDdJlVsOiiwxXWNfEHmHHkj6DEGpuh3LRpZ6dc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VX2BkfJkOQc7VYqYoAYGT6m+tg94S+EAS1eDWUgjqXVl9jlis7MCw143RODShThbd BoC2IuXaPPeeD0VxMY+nAZmimPAd3iGyVwW2tJ3n6OmdvUootM43nYuMi3ku9kSFr7 8omzobVlmv8eNWz9jyIikoldurFNx0cN0eHR2zzifMhwGorte/nw3M3KRXUfLWAGkJ pqD/eTlDAHrJOb8gMvQUDEIkA0XokaMDWCxRqi6Hi8E8fN8grHBkKssoKVkJLoNpST NCwKWqG7O5wn4OG8fDpYnP0+VP2ogE/a1mumxJGYo8lxdwW9TMw4nmPTsWO05A08cu tqnMnYlJGIHWg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D09C69E42 for ; Thu, 26 Feb 2026 13:02:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136143; bh=Y4cZpA94LYamLvJ/7wdtTyZ0YDNgtc7lA3chZJjM8a8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRmeb0DrmmcWjXEvkGvbTruAlaS7KqV1ufw2ixCUojnqJroUsKMe/lH35iZbQDkuH UJ6i2/r33ytPgQJnOGPEH1KF5hdVO2DoS3gThGoa7MJKQg1nEQwyAIgrBaLGnYbm+U kUgSo0Kj7ruuIRm4PR5z/YE6Nx8h85N2hnXPXYNyKcoCNGtZyhZV2V/f2FFLAmyLQs zTRfxxoQZc6aCYrpcwjwOixhGCkXUhUHiYG+N9frVTACbtqeGSK/9ogjgHSBxfBOqt 49YOfJBWiVAN7tZqO5pzPDMK1J7h68v3cRDu4cakMGxIuS+nMiKpShtae6khBcAnOa 2x65s/VlsoseA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7A1A669DAB; Thu, 26 Feb 2026 13:02:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Ljneo7_fYA1H; Thu, 26 Feb 2026 13:02:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136142; bh=KHo4Vd88u/mYTpA/j4AT8PQxrSvfccBnXtLqOtzLNVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+RxpebxeXGLTw72nolsP1HDQTefYpHCv2nm1Sx2YYVgcXkpgrA2da6p55R3kffl3 udz2LyO4eSq5Domc1cgcs+KZ6UnnfPp7Po5v6cnLtSSXQSqtf3NhZvAIHe52JLhNGF 9O/bFn/oxN2pvKjW34y+gxMgU08Ngk/8fCoKywpNHJ66Ly2/J2F5tq+AFXMC8J+djX WyAAXRagau5wdwrchkBDNpWU8ah18+zPMGknPoWinK5VEvOuZ6K/9mMxd4mofq0lnC 85eZASXA+OEYzTHWJOf0mtECNU0rN4ShLlxQSvR0tbpsNVr2oX59/LP0KuhDVadrA4 t1Wyutzv0VS9A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2F3C469D4A; Thu, 26 Feb 2026 13:02:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:20 -0700 Message-ID: <20260226200106.1727176-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZY4KHGL2S4QHV5MGKJXIHVIFILDXJLJA X-Message-ID-Hash: ZY4KHGL2S4QHV5MGKJXIHVIFILDXJLJA X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/32] patman: Make remote a required positional for patchwork project commands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass A project has multiple upstreams, so the remote must always be specified when setting or getting a project. Change the parameter to a required positional argument and rename it from 'upstream' to 'remote' for clarity. Usage: patman pw set-project U-Boot us patman pw get-project us Also rename the project list column header from 'Upstream' to 'Remote'. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 10 +++++----- tools/patman/control.py | 10 +++++++--- tools/patman/cseries.py | 4 ++-- tools/patman/test_cseries.py | 16 +++++++++++----- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index f08287641dd..a1697994571 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -156,19 +156,19 @@ def add_patchwork_subparser(subparsers): 'patchwork', aliases=ALIASES['patchwork'], help='Manage patchwork connection') patchwork.defaults_cmds = [ - ['set-project', 'U-Boot'], + ['set-project', 'U-Boot', 'us'], ] patchwork_subparsers = patchwork.add_subparsers(dest='subcmd') gproj = patchwork_subparsers.add_parser('get-project') gproj.add_argument( - '-u', '--upstream-name', - help='Upstream to get the project for') + 'remote', nargs='?', + help='Remote to get the project for') uset = patchwork_subparsers.add_parser('set-project') uset.add_argument( 'project_name', help="Patchwork project name, e.g. 'U-Boot'") uset.add_argument( - '-u', '--upstream-name', - help='Upstream to associate this project with') + 'remote', nargs='?', + help='Remote to associate with this project') patchwork_subparsers.add_parser('list') return patchwork diff --git a/tools/patman/control.py b/tools/patman/control.py index bd9e0f8b9bd..4363802cb3b 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -272,12 +272,16 @@ def patchwork(args, test_db=None, pwork=None): try: cser.open_database() if args.subcmd == 'set-project': + if not args.remote: + raise ValueError('Please specify the remote name') if not pwork: pwork = Patchwork(args.patchwork_url) cser.project_set(pwork, args.project_name, - ups=args.upstream_name) + ups=args.remote) elif args.subcmd == 'get-project': - ups = args.upstream_name + if not args.remote: + raise ValueError('Please specify the remote name') + ups = args.remote info = cser.project_get(ups) if not info: raise ValueError( @@ -287,7 +291,7 @@ def patchwork(args, test_db=None, pwork=None): msg = (f"Project '{name}' patchwork-ID {pwid} " f"link-name '{link_name}'") if ups: - msg += f" upstream '{ups}'" + msg += f" remote '{ups}'" print(msg) elif args.subcmd == 'list': cser.project_list() diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index fdf48a4eabd..3d24dd62fae 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -666,7 +666,7 @@ class Cseries(cser_helper.CseriesHelper): msg = f"Project '{name}' patchwork-ID {proj_id} " msg += f"link-name '{link_name}'" if ups: - msg += f" upstream '{ups}'" + msg += f" remote '{ups}'" tout.notice(msg) def project_get(self, ups=None): @@ -689,7 +689,7 @@ class Cseries(cser_helper.CseriesHelper): if not settings: print('No patchwork projects configured') return - print(f"{'Project':20} {'ID':>4} {'Link name':15} Upstream") + print(f"{'Project':20} {'ID':>4} {'Link name':15} Remote") border = f"{'-' * 20} {'-' * 4} {'-' * 15} {'-' * 15}" print(border) for name, proj_id, link_name, ups in settings: diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index f21fda8d2fa..b9be1680199 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -2483,23 +2483,29 @@ Tested-by: Mary Smith # yak self.assertFalse(cser.project_get()) + cser.db.upstream_add('us', 'https://us.example.com') + cser.db.commit() + pwork = Patchwork.for_testing(self._fake_patchwork_cser) with terminal.capture() as (out, _): self.run_args('-P', 'https://url', 'patchwork', 'set-project', - 'U-Boot', pwork=pwork) + 'U-Boot', 'us', pwork=pwork) self.assertEqual( - f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} link-name 'uboot'", + f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} " + f"link-name 'uboot' remote 'us'", out.getvalue().strip()) - name, pwid, link_name = cser.project_get() + name, pwid, link_name = cser.project_get('us') self.assertEqual('U-Boot', name) self.assertEqual(6, pwid) self.assertEqual('uboot', link_name) with terminal.capture() as (out, _): - self.run_args('-P', 'https://url', 'patchwork', 'get-project') + self.run_args('-P', 'https://url', 'patchwork', 'get-project', + 'us') self.assertEqual( - f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} link-name 'uboot'", + f"Project 'U-Boot' patchwork-ID {self.PROJ_ID} " + f"link-name 'uboot' remote 'us'", out.getvalue().strip()) def test_patchwork_list(self): From patchwork Thu Feb 26 20:00:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1952 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136148; bh=U9qhuT8WFP0PglI+IzEoDbxs1yeQmgnLbSrX0Yhz7LI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IGfTtSmQP4vulvlTLa2kuhtZEoQDCjvJTR3R16pKicYBQx0eErW+4dzh7me51eeyT IM3/nNJkT653lhEbBLTtXwCgiFFoVjupkTs/cY9cUhXuem529DLqQMgoZfMKs5K3Wf fI/g3ttrKhnL7Pm12DmYYq4N7XEftll2/wQupycH2ZUoSMrlM3NONh6Xj/MQUjRls1 6tG6qck3f7QxypM/xqzjEp3HWFn0XmMZ4q4mTI+1BRhnX8IbiQvTg9hJun08+x+sMd KD5nnpYDnMxJpDP1b8uzYNSOy3ZGWm5vLyiwuFhjMphrprdF9NBwWYKeleY2qbEVqZ FSqljH0pEOQkg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 932B569E35 for ; Thu, 26 Feb 2026 13:02:28 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Gtoe5K5A5rGe for ; Thu, 26 Feb 2026 13:02:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136146; bh=U9qhuT8WFP0PglI+IzEoDbxs1yeQmgnLbSrX0Yhz7LI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UhxN7NHNuD/ll9c0bYIrn4rCK3sWZUsZC8l3xHKWh5lqh3UfaFxzgS6HTk0DYzuqt CuzNqZuAf5SxGpYC8gGyU7LoWA6fmPzA1mEnXOU6Cp376n8EqeQdKyXNuDgZNKm7D4 TV9neZoIQTbll5jZ+oGdFgmbh/5yI3y97Dpv3KtsHRuaCdYfS3EdKCGd+kbGXySu1g nNcXyXD1wEzpaW/Gkh3feOGyLXsnP+Cq2yInawoCkEM1blL9YYkTPHGS61vSTTXSHv rcCVc3nQHmQ68C2I5XDkyJrZDGNvm7yRJCFEjnuBHobOM2wUvGX6h9LuzHHSGPrkro sdXG0PQEXMDvA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A042269E3A for ; Thu, 26 Feb 2026 13:02:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136143; bh=UXRAp/pr8ank+NVrOIPHMoXtrNv8XYvb2d2GOMw2Ijw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LPoU5hsx3aPfuj4tWnGTHe6BzOPc45/uYjJ+3CPmihpfs+6AhEHeDwyevQjpoZoJj GmfBerU6htabybFUVmBayF5xGa/WXfRRh8ufmFlJQWiBhE8j0lw5ymZEXKVeKwXOa7 0m1uq2NCHb2gFGDuKdsdID5LFyW71p/yNY4rRrpaknBty80OxbqVTfDf5cdQqEvwVq yECb8TAOeYgcHAtjllN3/kOiOREFcLjGoX5QjXbFqd5Yj5Asfxi8sTCQa6sNP0+6HF dg8gmkW2wIOZ/UgZoy82yO1iVYRyRNdsnQ7LITKHnUDk6d7+OtL5blYiBqX9/1VdZv OIWtZtK4YFQgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A28CD69D4A; Thu, 26 Feb 2026 13:02:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id of6BD_lGhGqd; Thu, 26 Feb 2026 13:02:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136143; bh=7JL6rU5lIZ1XuHlwGn++Vb5kAKczgbmDD6ehiNfY/C8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HB8dbUQxkvs9Snfe1D6Y/6JQbcrnXb65N5SrjblrI7CBw2FrG6YAXjWtm7xBP2r1R 9qsekznTYW0cowhv4nQ0A5Zw0UUsV60ncyY9yTA7wisL3M7husGVgoO36y5GSjFJIq l1PNXyIr/QYnWOH1wpVJrTvdNCKyrT/SAfefmFGy/nB9ivd9QMJ3tobvWzx72EboDL 6/grvNr/tfT9a72lbxMnK1qFxvFHio6yM10EHwTgDGemknuXC9Ckxe51Ku1BTJr/jt NEAHszLucGutY0asgaYHYEZoq31Qwk/69GH0IpmOO7ibRGMZ+DDUC1vYD9qdvWucJG deK49ZsqT0sJw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 13D0A69D79; Thu, 26 Feb 2026 13:02:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:21 -0700 Message-ID: <20260226200106.1727176-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CK2BR2VO4JYISDR6LSZGYZ6HLW3BF7ZE X-Message-ID-Hash: CK2BR2VO4JYISDR6LSZGYZ6HLW3BF7ZE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/32] patman: Group remotes by project in patchwork list List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass A project can have multiple remotes, so group them on a single line rather than showing one row per remote. Sort by project name then upstream in the patchwork table query. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 13 +++++++++++-- tools/patman/database.py | 2 +- tools/patman/test_cseries.py | 9 ++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 3d24dd62fae..7237dd575cd 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -689,11 +689,20 @@ class Cseries(cser_helper.CseriesHelper): if not settings: print('No patchwork projects configured') return - print(f"{'Project':20} {'ID':>4} {'Link name':15} Remote") + print(f"{'Project':20} {'ID':>4} {'Link name':15} Remotes") border = f"{'-' * 20} {'-' * 4} {'-' * 15} {'-' * 15}" print(border) + + # Group remotes by project + projects = OrderedDict() for name, proj_id, link_name, ups in settings: - print(f'{name:20} {proj_id:4} {link_name:15} {ups or ""}') + key = (name, proj_id, link_name) + projects.setdefault(key, []) + if ups: + projects[key].append(ups) + for (name, proj_id, link_name), remotes in projects.items(): + rlist = ' '.join(sorted(remotes)) + print(f'{name:20} {proj_id:4} {link_name:15} {rlist}') print(border) def remove(self, name, dry_run=False): diff --git a/tools/patman/database.py b/tools/patman/database.py index 396cf52aa48..2f21e62605f 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -896,7 +896,7 @@ class Database: # pylint:disable=R0904 """ res = self.execute( 'SELECT name, proj_id, link_name, upstream FROM patchwork ' - 'ORDER BY upstream') + 'ORDER BY name, upstream') return res.fetchall() def patchwork_get(self, ups=None): diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index b9be1680199..2a31815932c 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -2518,11 +2518,13 @@ Tested-by: Mary Smith # yak self.assertEqual('No patchwork projects configured', out.getvalue().strip()) - # Add projects for two upstreams + # Add two remotes for U-Boot and one for Linux cser.db.upstream_add('us', 'https://us.example.com') cser.db.upstream_add('ci', 'https://ci.example.com') + cser.db.upstream_add('linus', 'https://linus.example.com') cser.db.patchwork_update('U-Boot', 6, 'uboot', 'us') - cser.db.patchwork_update('Linux', 10, 'linux', 'ci') + cser.db.patchwork_update('U-Boot', 6, 'uboot', 'ci') + cser.db.patchwork_update('Linux', 10, 'linux', 'linus') cser.db.commit() with terminal.capture() as (out, _): @@ -2530,8 +2532,9 @@ Tested-by: Mary Smith # yak lines = out.getvalue().splitlines() self.assertEqual(5, len(lines)) self.assertIn('Linux', lines[2]) - self.assertIn('ci', lines[2]) + self.assertIn('linus', lines[2]) self.assertIn('U-Boot', lines[3]) + self.assertIn('ci', lines[3]) self.assertIn('us', lines[3]) def test_patchwork_upstream(self): From patchwork Thu Feb 26 20:00:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1953 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136152; bh=A0YE0GOPz/aEA1U1HarwILZgQCwfIml6eXXWtNfXw0o=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cDgV/C0NzpxeAcER/6vn28mZiD/09dKFXBIZdZ/av+b2z4mmZBQnOk3stoyFO4oJv 0wgZRmlLKg8m3G//jQJAj0Vg6lxNeYhXMxbjuw4cJW6JAaM/VFiMI8vW6/NUb5xdsu kAzvmnXfGviPienE/Te4arW1FFIf78TUsIseBF8hA3h1CmsDLrAK8p1UBucS3xKCHA MBc+/SN86CGfSiwNSFMAdd+7K2m7fxkpZbIBWn3OI31yaxFgK+K4TxdmMxoDrZcDO2 fNSqEFLTOBfXYxFPrddtBlXZ2WAALnnlLaVM72RQ31M0zSC/u2yIpwVkfBTOZLzz25 ksWdLZ1WFqebQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 23F8C69E35 for ; Thu, 26 Feb 2026 13:02:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id s6wJ9e9klkgi for ; Thu, 26 Feb 2026 13:02:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136152; bh=A0YE0GOPz/aEA1U1HarwILZgQCwfIml6eXXWtNfXw0o=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cDgV/C0NzpxeAcER/6vn28mZiD/09dKFXBIZdZ/av+b2z4mmZBQnOk3stoyFO4oJv 0wgZRmlLKg8m3G//jQJAj0Vg6lxNeYhXMxbjuw4cJW6JAaM/VFiMI8vW6/NUb5xdsu kAzvmnXfGviPienE/Te4arW1FFIf78TUsIseBF8hA3h1CmsDLrAK8p1UBucS3xKCHA MBc+/SN86CGfSiwNSFMAdd+7K2m7fxkpZbIBWn3OI31yaxFgK+K4TxdmMxoDrZcDO2 fNSqEFLTOBfXYxFPrddtBlXZ2WAALnnlLaVM72RQ31M0zSC/u2yIpwVkfBTOZLzz25 ksWdLZ1WFqebQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 12CA269D79 for ; Thu, 26 Feb 2026 13:02:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136150; bh=VotnKwZ8RvTk9WRO6RyzbeYF2u3N6Q1d5Gljn5xPWsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z4YI6d88iTvw2GtbyN/Tw8YjrUWox3bAZRcwd7VuY76Ip0mwsIeBu+iDfhyaINvTw PwyRwSeaC1A3Uu2QN1qHqm5GC8lqCEWT6YQolu1hdNJzQbsG0hc3W7136PNwShXMQu OJhQkpY1rAYSozxlaDjDJFQFXCs7FbhsCQSuJgiZdLn+QYGlcppfpBJNJcpGgIrcfO fW9uHURWFCMmZDLV6r9yh48YasNtFYIbqFl72BPTZMsEMBkA7xEP1csBnbJR1X5JTT epAtb8Okb68OXsLGq9obfP76CyADkGs0ATWJibHfzk9b9KMn8gD5uaKR1hcf85NDWx sGCEAEx/eGztQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DEF1C69D4A; Thu, 26 Feb 2026 13:02:30 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id qQieKjw2nP7j; Thu, 26 Feb 2026 13:02:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136144; bh=b8Jfb9ogE7MJltRNMbN4vRVZYKrgOn17RnbMp5c5iqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQY2DggC6HeqzOAfIHlx8W8ruPRpjw23Oe3m46zQtapBFCtf53i77Cl4eiqYiKaMT 4n6MFl2277A25hlKkiDsNC0OuSyp13vCGBsgbk0flI1lG9B5qvAT4lrEJXdqOdkK1Q GgMrmVDYWJOpVOeaG8hXK0vWha7+rJeDphaJoog2BJlkNITqVQaShPHUV9Ro3rNC7c /2WYy7So4ilZfg2cBgPYs9G7mQA556x1dfMIkXqHt1EfhRVqwnbSNqiiQyimlNusZw pr2aAR44WmLjD91zijl2ethAP81H7isrEcOzgXvY4hqqpIYmXETCXnCrawsWpA1AUI +MukcAt1X38Ew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E508A69D79; Thu, 26 Feb 2026 13:02:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:22 -0700 Message-ID: <20260226200106.1727176-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4CYK3GMBUVHFCGWTRZOTBVHL2Y4E5NES X-Message-ID-Hash: 4CYK3GMBUVHFCGWTRZOTBVHL2Y4E5NES X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/32] patman: Allow specifying project when adding an upstream List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When adding an upstream with 'us add', allow an optional project name to be specified. This creates the settings row linking the remote to its patchwork project in a single step, rather than requiring a separate 'pw set-project' call. Usage: patman us add origin https://example.com 'U-Boot' Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 5 ++++- tools/patman/control.py | 6 +++++- tools/patman/cseries.py | 12 ++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index a1697994571..8df9966ec6d 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -406,7 +406,7 @@ def add_upstream_subparser(subparsers): upstream = subparsers.add_parser('upstream', aliases=ALIASES['upstream'], help='Manage upstream destinations') upstream.defaults_cmds = [ - ['add', 'us', 'http://fred'], + ['add', 'us', 'http://fred', 'U-Boot'], ['delete', 'us'], ] upstream_subparsers = upstream.add_subparsers(dest='subcmd') @@ -416,6 +416,9 @@ def add_upstream_subparser(subparsers): uadd.add_argument( 'url', help='URL to use for this upstream, e.g. ' "'https://gitlab.denx.de/u-boot/u-boot.git'") + uadd.add_argument( + 'project_name', nargs='?', + help="Patchwork project name, e.g. 'U-Boot'") udel = upstream_subparsers.add_parser('delete') udel.add_argument( 'remote_name', diff --git a/tools/patman/control.py b/tools/patman/control.py index 4363802cb3b..c8d7405f7e8 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -239,7 +239,11 @@ def upstream(args, test_db=None): try: cser.open_database() if args.subcmd == 'add': - cser.upstream_add(args.remote_name, args.url) + pwork = None + if args.project_name: + pwork = Patchwork(args.patchwork_url) + cser.upstream_add(args.remote_name, args.url, + args.project_name, pwork) elif args.subcmd == 'default': if args.unset: cser.upstream_set_default(None) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 7237dd575cd..c48267964a1 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -1145,16 +1145,24 @@ class Cseries(cser_helper.CseriesHelper): self.rollback() tout.info('Dry run completed') - def upstream_add(self, name, url): + def upstream_add(self, name, url, project=None, pwork=None): """Add a new upstream tree Args: name (str): Name of the tree url (str): URL for the tree + project (str or None): Patchwork project name to associate + pwork (Patchwork or None): Patchwork object for looking up + the project """ self.db.upstream_add(name, url) + if project: + self.project_set(pwork, project, ups=name, quiet=True) self.commit() - tout.notice(f"Added upstream '{name}' ({url})") + msg = f"Added upstream '{name}' ({url})" + if project: + msg += f" project '{project}'" + tout.notice(msg) def upstream_list(self): """List the upstream repos From patchwork Thu Feb 26 20:00:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1954 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136156; bh=t9f+1BrEdJbvxQF6E/XNpRYsltZMhJ90CijTzwMb4mI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SBSghC3AbalIfELbQSkNEP7dXtrbZ58ktlkMHrCnYajUw3IWkIvq2ZIifVIj0Nv6a yiZ+TPecWG+Pu8RmaMPw4R7yAdf0F4+UUagYos06mJkziLBOXj32b74Sa//aKqmQIH nJdV+k2n0lrLGf/kwb+rktElKl0GZvzca3ifmY/iahZ3GhLKD8s/TyrnuwIjKJX9Pi kBSermwig53V4gMa9WZnzyI1JEV9QypLjkjn6DUSX+VlzyhS6mWMIIguUTXlZfdCHT fVxHrAHjTkfL7zq0m5QsmL7VzfWJS8TiSj8VSlMngcXPWiFEMISCpW/qwbX43S3rXn 6J3ootGzSFVVA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 879B469E39 for ; Thu, 26 Feb 2026 13:02:36 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HjgvqlKClvBs for ; Thu, 26 Feb 2026 13:02:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136156; bh=t9f+1BrEdJbvxQF6E/XNpRYsltZMhJ90CijTzwMb4mI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SBSghC3AbalIfELbQSkNEP7dXtrbZ58ktlkMHrCnYajUw3IWkIvq2ZIifVIj0Nv6a yiZ+TPecWG+Pu8RmaMPw4R7yAdf0F4+UUagYos06mJkziLBOXj32b74Sa//aKqmQIH nJdV+k2n0lrLGf/kwb+rktElKl0GZvzca3ifmY/iahZ3GhLKD8s/TyrnuwIjKJX9Pi kBSermwig53V4gMa9WZnzyI1JEV9QypLjkjn6DUSX+VlzyhS6mWMIIguUTXlZfdCHT fVxHrAHjTkfL7zq0m5QsmL7VzfWJS8TiSj8VSlMngcXPWiFEMISCpW/qwbX43S3rXn 6J3ootGzSFVVA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7624D69DAB for ; Thu, 26 Feb 2026 13:02:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136154; bh=mLEoRzgQHYQIr7wiaJHGRjM8r8ojHZEHjQg5DQXiIkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFK/YRFi2LsCzqJq2SgYFvTcl+JC+keuaTYBmp43mjPecgPmWkFXR7qWG/pdYJPWZ hrUxNM+1L2qKxI9Om8icpB1X1aK2FVg/em3P8A3zDacOZNbe0iuoUCoOzJZQbvweH/ XIMSk9td34QBvnom2NPLCmHWmhlGZOJT5QSaNg0yoo9govmafGZv5PP08KgzWcPAvY HArYJyXsop4JJW1mPDn5Y33CJ2K/Baax88+QHVvGdWzgn4vpv3SQLEorYkez2c1d/N V9DD0FRX7K03Bj8aMgJ4Tv/1Id0gESjQNe1y3PHU5G2lWWvLzSISD21YktENbYO5Ro S5Ft9rqF4GVtg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8877069D79; Thu, 26 Feb 2026 13:02:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 41o0Eo6CZG7z; Thu, 26 Feb 2026 13:02:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136148; bh=w0FNKRbw9s7Fl+nbsx1guzXFbK/exzWCiZyyZBKwRAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=stOqYG8jBQz0MXvCztWEnt653TB00DnovOFwLKhM5PMVK6qtmld2+Yx9l+9PZel4/ GJIOjZVv/Zg36YrToQiIX1FumI2JKTImDa3UsMKgxVNuWfzE7qYpLYseXli8A/A4sI 80OVfSyFJt7WKtnrLVJvf6ZNkYI27UY+wjVwkrblvqtJEqDEvvgvpI9ykUibuXWLvM gOFAGHIivZpL8LSyGtm5Bu9Sbb8ShS6St/SQNYhHVcen2A2aAk0St7pMS5PtN14jNI +yBFYgHVXyTzVwKAdscZ9jwMehO5gTM33THJ5CqieE7gAK+0hTgnf83fCNf5Fs7tyy 6elABOEqHweog== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 936B869E48; Thu, 26 Feb 2026 13:02:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:23 -0700 Message-ID: <20260226200106.1727176-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VADRKVIF5MKACR7MMOS43OGXUBVP2RVU X-Message-ID-Hash: VADRKVIF5MKACR7MMOS43OGXUBVP2RVU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/32] patman: Rename -u/--use-commit to -1/--use-first-commit List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Free up -u for a future upstream option by renaming the flag that uses the first commit's subject as the series description. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 2 +- tools/patman/control.py | 2 +- tools/patman/test_cseries.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 8df9966ec6d..090d9845ec1 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -237,7 +237,7 @@ def add_series_subparser(subparsers): add.add_argument('-D', '--desc', help='Series description / cover-letter title') add.add_argument( - '-u', '--use-commit', action='store_true', + '-1', '--use-first-commit', action='store_true', help="Use the first commit's subject as series description if needed") add.add_argument( '-f', '--force-version', action='store_true', diff --git a/tools/patman/control.py b/tools/patman/control.py index c8d7405f7e8..c65fd3d5f1f 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -151,7 +151,7 @@ def do_series(args, test_db=None, pwork=None, cser=None): if args.subcmd == 'add': cser.add(args.series, args.desc, mark=args.mark, allow_unmarked=args.allow_unmarked, end=args.upstream, - use_commit=args.use_commit, dry_run=args.dry_run) + use_commit=args.use_first_commit, dry_run=args.dry_run) elif args.subcmd == 'archive': cser.archive(args.series) elif args.subcmd == 'autolink': diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 2a31815932c..083727889f8 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -455,7 +455,7 @@ class TestCseries(unittest.TestCase, TestCommon): str(exc.exception)) with terminal.capture() as (out, _): - self.run_args('series', '-s', 'first', 'add', '--use-commit', + self.run_args('series', '-s', 'first', 'add', '--use-first-commit', '--allow-unmarked', pwork=True) lines = out.getvalue().splitlines() self.assertEqual( @@ -799,7 +799,7 @@ Tested-by: Mary Smith # yak self.make_git_tree() args = Namespace(subcmd='add', desc='my-description', series='first', mark=False, allow_unmarked=True, upstream=None, - use_commit=False, dry_run=False) + use_first_commit=False, dry_run=False) with terminal.capture() as (out, _): control.do_series(args, test_db=self.tmpdir, pwork=True) @@ -847,7 +847,7 @@ Tested-by: Mary Smith # yak force=True) args = Namespace(subcmd='add', series=None, mark=False, allow_unmarked=True, upstream=None, dry_run=False, - desc=None, use_commit=False) + desc=None, use_first_commit=False) with terminal.capture(): control.do_series(args, test_db=self.tmpdir, pwork=True) From patchwork Thu Feb 26 20:00:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1955 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136161; bh=ty1LtIQtOM2I0RsLNfSoejMeRwZOERJwKLlIlYpTNm4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tj34SlW8G6fiXfWfPLkwCpC5mDiBRpQoF6zzx0BSzgYTQAMHElyBu0hHFJQMyjy/A xHgQYhv+1A01dlMigavVPk1wb5E5pfQ5j6OIK6cojSWymBVKgL+2269t+nptF+CvzN 8K8OWMQTB0Y4qtDiCpVpw6z/Ygie0xgvS1cfcz3h7LzLYisMNi3Vtmeysbgzw7ds/W PrG5IvmPNOA+egNiUu87Fngq8Q5q9aRmndHSqbUsOPYgq2pfdGyD5NJ5d5QnAPK/E8 BK1lBvMGz+h5yb/XH/2P6YUuVVckN8jdy9p+l8Vv52QSaNcnoJyyWfx4qhc5Yz7mF6 nBzYySjq0VwGg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 02C2E69E39 for ; Thu, 26 Feb 2026 13:02:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZUh1xdgOWQZx for ; Thu, 26 Feb 2026 13:02:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136160; bh=ty1LtIQtOM2I0RsLNfSoejMeRwZOERJwKLlIlYpTNm4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Pg16Jxly7yNiZwsBMV3KQDexY2z5vzAxWw6Ioj8Co0CZ6sst6s2vKZV1vpK9itvvX ZIWalk1DVIixYKVIG2pFgTMqCJCqSYvL13JlquQrMKCvJ1rXgiOJ7DbUQ5TxEfmzN7 0WfSRSu/9gbQib2KO4ZBa11+y5Rh+9gTuuI362whz/vj05GdwgRUDl5mB9De60hAfP it8ARRM7v0NFJGMr7uKgN6iztyK+ih/GVfDw9dDDu8Ub9mIWSxspy31mjYx8N0ms/q HOWWUd0SEVIdqD2ks9e73aMrx8wl09T/9gf8KN7coxmOmGMfvXEvhaPr3qDA7a/4Oa yfoSWwoqFtniA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E672969DAB for ; Thu, 26 Feb 2026 13:02:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136158; bh=fzyyS7HhgpfV73vM+EcaNebj9e3LQkHA8d/dM4RBLU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pollu76iicqPrsWajOsYC/Pa2cQB6mjIbht5EINHII9+ia19Ri/ilQKiKMTmZ+BWH 9MchNbI3oezeKC5VH0zoT0LyooCbdyfonrnzsguPqmFqwXFbYslNxfTW6WsLKo9Vwc xz9xX13K+V2Qdau8pYCcpwCHztgIDj9znPVDFWBJOskLFoKzMDByFmXQ112tecrgvY jacApHCGoQZ8kaB7NEkT+4xRflHgw1AsVp0qiFOGLCxZqWtTjhZmZK4AckYduzMdRi cACTags9y2ohBLDVo4YaM6JYIkK1R8jZa1WMf5x+6bSgXwh9Bgmf3xCgHi8j6wbEZu dXGxOciJFOy0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E640869DAB; Thu, 26 Feb 2026 13:02:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id lS0id_8bl1D6; Thu, 26 Feb 2026 13:02:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136153; bh=Xd0+dNb1KbAmIZHnAxgNxRfTqDC3YdD/lvhi7iM1pZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hhnEcQDY3Y62bri05eqXZgzj8Fe8H5o8artiJOll7zyWj28Gz/VvsRucSlX5V3rmH 4u2TvrOlJ5Qoxpp+8Dk6GYWaEeBCYJnshCfhEp5xnEFkYo0S/UJNv1dr5CrAzOeDPC INYk6VwelpC0fhA3EnQvWmt6bgfQZ2E4MsLjaGHclCUcepwjizu9gXLN+zx5SRIYI7 cxU5DzyfjQnCvviWVlUpvHX92H2hM+v78MLVHga9WTsqA+/kZwJys8dIUH1VRF2thK TWQs3SbIKiimjQPv3rzvlWhYUUda2PFiL9AGPKhJ5UkiO6dYsXr5h8zqEKHfYTWm5j OeIsUp2jIL1CQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 441F669D4A; Thu, 26 Feb 2026 13:02:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:24 -0700 Message-ID: <20260226200106.1727176-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YXINTPCZEGPY7PAE3ZAG5HLDTUQ55DAG X-Message-ID-Hash: YXINTPCZEGPY7PAE3ZAG5HLDTUQ55DAG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/32] patman: Add per-upstream patchwork URL List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Currently patman uses a single global --patchwork-url flag. Add a patchwork_url field to each upstream so the URL can be looked up automatically from the database. Update upstream_add() and upstream_get_dict() to handle the new field and add upstream_get_patchwork_url() for direct lookup. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 6 +++- tools/patman/control.py | 28 +++++++++++++++---- tools/patman/cseries.py | 27 ++++++++++++++---- tools/patman/database.py | 34 +++++++++++++++++++---- tools/patman/test_cseries.py | 53 ++++++++++++++++++++++++++++++------ 5 files changed, 122 insertions(+), 26 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 090d9845ec1..f24d0aacdff 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -406,7 +406,7 @@ def add_upstream_subparser(subparsers): upstream = subparsers.add_parser('upstream', aliases=ALIASES['upstream'], help='Manage upstream destinations') upstream.defaults_cmds = [ - ['add', 'us', 'http://fred', 'U-Boot'], + ['add', 'us', 'http://fred', '-p', 'http://pw', 'U-Boot'], ['delete', 'us'], ] upstream_subparsers = upstream.add_subparsers(dest='subcmd') @@ -416,6 +416,10 @@ def add_upstream_subparser(subparsers): uadd.add_argument( 'url', help='URL to use for this upstream, e.g. ' "'https://gitlab.denx.de/u-boot/u-boot.git'") + uadd.add_argument( + '-p', '--patchwork-url', + help='URL of patchwork server for this upstream, e.g. ' + "'https://patchwork.ozlabs.org'") uadd.add_argument( 'project_name', nargs='?', help="Patchwork project name, e.g. 'U-Boot'") diff --git a/tools/patman/control.py b/tools/patman/control.py index c65fd3d5f1f..e1f52300a17 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -134,8 +134,18 @@ def do_series(args, test_db=None, pwork=None, cser=None): cser.open_database() if args.subcmd in needs_patchwork: if not pwork: - pwork = Patchwork(args.patchwork_url) ups = cser.get_series_upstream(args.series) + pw_url = None + if ups: + pw_url = cser.db.upstream_get_patchwork_url(ups) + if not pw_url: + pw_url = args.patchwork_url + if not pw_url: + raise ValueError( + 'No patchwork URL found for upstream ' + f"'{ups}'; use 'patman upstream add' with " + '-p or pass --patchwork-url') + pwork = Patchwork(pw_url) proj = cser.project_get(ups) if not proj: proj = cser.project_get() @@ -239,11 +249,9 @@ def upstream(args, test_db=None): try: cser.open_database() if args.subcmd == 'add': - pwork = None - if args.project_name: - pwork = Patchwork(args.patchwork_url) cser.upstream_add(args.remote_name, args.url, - args.project_name, pwork) + args.project_name, + patchwork_url=args.patchwork_url) elif args.subcmd == 'default': if args.unset: cser.upstream_set_default(None) @@ -279,7 +287,15 @@ def patchwork(args, test_db=None, pwork=None): if not args.remote: raise ValueError('Please specify the remote name') if not pwork: - pwork = Patchwork(args.patchwork_url) + pw_url = cser.db.upstream_get_patchwork_url(args.remote) + if not pw_url: + pw_url = args.patchwork_url + if not pw_url: + raise ValueError( + f"No patchwork URL for remote '{args.remote}'" + "; use 'patman upstream add' with -p" + ' or pass --patchwork-url') + pwork = Patchwork(pw_url) cser.project_set(pwork, args.project_name, ups=args.remote) elif args.subcmd == 'get-project': diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index c48267964a1..612ccfda7dc 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -16,6 +16,7 @@ from u_boot_pylib import terminal from u_boot_pylib import tout from patman import patchstream +from patman.patchwork import Patchwork from patman import cser_helper from patman.cser_helper import AUTOLINK, oid from patman import send @@ -1145,7 +1146,8 @@ class Cseries(cser_helper.CseriesHelper): self.rollback() tout.info('Dry run completed') - def upstream_add(self, name, url, project=None, pwork=None): + def upstream_add(self, name, url, project=None, pwork=None, + patchwork_url=None): """Add a new upstream tree Args: @@ -1154,12 +1156,21 @@ class Cseries(cser_helper.CseriesHelper): project (str or None): Patchwork project name to associate pwork (Patchwork or None): Patchwork object for looking up the project + patchwork_url (str or None): URL of the patchwork server for + this upstream """ - self.db.upstream_add(name, url) + self.db.upstream_add(name, url, patchwork_url) if project: + if not pwork: + if not patchwork_url: + raise ValueError( + 'Patchwork URL is required when setting a project') + pwork = Patchwork(patchwork_url) self.project_set(pwork, project, ups=name, quiet=True) self.commit() msg = f"Added upstream '{name}' ({url})" + if patchwork_url: + msg += f" patchwork '{patchwork_url}'" if project: msg += f" project '{project}'" tout.notice(msg) @@ -1167,14 +1178,20 @@ class Cseries(cser_helper.CseriesHelper): def upstream_list(self): """List the upstream repos - Shows a list of the repos, obtained from the database + Shows a list of the repos, obtained from the database, along with + any associated patchwork project """ udict = self.get_upstream_dict() for name, items in udict.items(): - url, is_default = items + url, is_default, patchwork_url = items default = 'default' if is_default else '' - print(f'{name:15.15} {default:8} {url}') + proj = self.db.patchwork_get(name) + proj_name = proj[0] if proj else '' + line = f'{name:10.10} {default:8} {proj_name:20} {url}' + if patchwork_url: + line += f' pw:{patchwork_url}' + print(line) def upstream_set_default(self, name): """Set the default upstream target diff --git a/tools/patman/database.py b/tools/patman/database.py index 2f21e62605f..f7ab2d84877 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -791,19 +791,21 @@ class Database: # pylint:disable=R0904 # upstream functions - def upstream_add(self, name, url): + def upstream_add(self, name, url, patchwork_url=None): """Add a new upstream record Args: name (str): Name of the tree url (str): URL for the tree + patchwork_url (str or None): URL of the patchwork server Raises: ValueError if the name already exists in the database """ try: self.execute( - 'INSERT INTO upstream (name, url) VALUES (?, ?)', (name, url)) + 'INSERT INTO upstream (name, url, patchwork_url) ' + 'VALUES (?, ?, ?)', (name, url, patchwork_url)) except sqlite3.IntegrityError as exc: if 'UNIQUE constraint failed: upstream.name' in str(exc): raise ValueError(f"Upstream '{name}' already exists") from exc @@ -853,18 +855,38 @@ class Database: # pylint:disable=R0904 self.rollback() raise ValueError(f"No such upstream '{name}'") + def upstream_get_patchwork_url(self, name): + """Get the patchwork URL for an upstream + + Args: + name (str): Upstream name + + Return: + str or None: Patchwork URL, or None if not set + """ + res = self.execute( + 'SELECT patchwork_url FROM upstream WHERE name = ?', (name,)) + rec = res.fetchone() + if rec: + return rec[0] + return None + def upstream_get_dict(self): """Get a list of upstream entries from the database Return: OrderedDict: key (str): upstream name - value (str): url + value: tuple: + str: url + bool: is_default + str or None: patchwork_url """ - res = self.execute('SELECT name, url, is_default FROM upstream') + res = self.execute( + 'SELECT name, url, is_default, patchwork_url FROM upstream') udict = OrderedDict() - for name, url, is_default in res.fetchall(): - udict[name] = url, is_default + for name, url, is_default, patchwork_url in res.fetchall(): + udict[name] = url, is_default, patchwork_url return udict # patchwork functions diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 083727889f8..b14c6c22ddc 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1730,14 +1730,14 @@ Tested-by: Mary Smith # yak cser.upstream_add('us', 'https://one') ulist = cser.get_upstream_dict() self.assertEqual(1, len(ulist)) - self.assertEqual(('https://one', None), ulist['us']) + self.assertEqual(('https://one', None, None), ulist['us']) with terminal.capture(): cser.upstream_add('ci', 'git@two') ulist = cser.get_upstream_dict() self.assertEqual(2, len(ulist)) - self.assertEqual(('https://one', None), ulist['us']) - self.assertEqual(('git@two', None), ulist['ci']) + self.assertEqual(('https://one', None, None), ulist['us']) + self.assertEqual(('git@two', None, None), ulist['ci']) # Try to add a duplicate with self.assertRaises(ValueError) as exc: @@ -1748,8 +1748,39 @@ Tested-by: Mary Smith # yak cser.upstream_list() lines = out.getvalue().splitlines() self.assertEqual(2, len(lines)) - self.assertEqual('us https://one', lines[0]) - self.assertEqual('ci git@two', lines[1]) + self.assertEqual( + 'us https://one', + lines[0]) + self.assertEqual( + 'ci git@two', + lines[1]) + + def test_upstream_add_patchwork_url(self): + """Test adding an upstream with a patchwork URL""" + cser = self.get_cser() + + with terminal.capture(): + cser.upstream_add('us', 'https://one', + patchwork_url='https://pw.example.com') + ulist = cser.get_upstream_dict() + self.assertEqual(1, len(ulist)) + self.assertEqual( + ('https://one', None, 'https://pw.example.com'), ulist['us']) + + # Check that the patchwork URL shows in the list + with terminal.capture() as (out, _): + cser.upstream_list() + lines = out.getvalue().splitlines() + self.assertEqual(1, len(lines)) + self.assertIn('pw:https://pw.example.com', lines[0]) + + # Check database lookup + pw_url = cser.db.upstream_get_patchwork_url('us') + self.assertEqual('https://pw.example.com', pw_url) + + # Non-existent upstream returns None + pw_url = cser.db.upstream_get_patchwork_url('nonexistent') + self.assertIsNone(pw_url) def test_upstream_add_cmdline(self): """Test adding an upsream with cmdline""" @@ -1760,7 +1791,9 @@ Tested-by: Mary Smith # yak self.run_args('upstream', 'list') lines = out.getvalue().splitlines() self.assertEqual(1, len(lines)) - self.assertEqual('us https://one', lines[0]) + self.assertEqual( + 'us https://one', + lines[0]) def test_upstream_default(self): """Operation of the default upstream""" @@ -1791,8 +1824,12 @@ Tested-by: Mary Smith # yak cser.upstream_list() lines = out.getvalue().splitlines() self.assertEqual(2, len(lines)) - self.assertEqual('us https://one', lines[0]) - self.assertEqual('ci default git@two', lines[1]) + self.assertEqual( + 'us https://one', + lines[0]) + self.assertEqual( + 'ci default git@two', + lines[1]) cser.upstream_set_default(None) self.assertIsNone(cser.upstream_get_default()) From patchwork Thu Feb 26 20:00:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1956 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136165; bh=H9VflLXY3wBuqnGVq8oDj4vyY4KSuiiyiBOIn0cAn2M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=l2UfY1JTdxFsH4ZqBSGf4yHjZVQQO8JWkK8f58WbDI1m/lsmXGmC0yQ8c/KiLrUtW gURPkk7mgYQQ/mxLfuoxECHdbErtqehduDJXMJolYfE+IrASpar5BhICW3k17f4zwU zHhqRA3txjbAyOsGMsQmAAwRcVFEjP2aWsezo5Rlm2xwtLGtfHljdgbFzGVAnevFws ay6CnkTkSrjm3po+YP0laxCECQBkcQy+BKiI1X3yz5fj2IvfXDD//IdtnBWtJtfEhI QFZdlavUlwDp/+6NSUAW9wyNBoSnbLLaSnvPyqDPaG7YY2cieYe2YMChkpzvAfN4q6 WxfiqEKeITF1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 738A869E39 for ; Thu, 26 Feb 2026 13:02:45 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XBMZJw2uGJ0u for ; Thu, 26 Feb 2026 13:02:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136165; bh=H9VflLXY3wBuqnGVq8oDj4vyY4KSuiiyiBOIn0cAn2M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=l2UfY1JTdxFsH4ZqBSGf4yHjZVQQO8JWkK8f58WbDI1m/lsmXGmC0yQ8c/KiLrUtW gURPkk7mgYQQ/mxLfuoxECHdbErtqehduDJXMJolYfE+IrASpar5BhICW3k17f4zwU zHhqRA3txjbAyOsGMsQmAAwRcVFEjP2aWsezo5Rlm2xwtLGtfHljdgbFzGVAnevFws ay6CnkTkSrjm3po+YP0laxCECQBkcQy+BKiI1X3yz5fj2IvfXDD//IdtnBWtJtfEhI QFZdlavUlwDp/+6NSUAW9wyNBoSnbLLaSnvPyqDPaG7YY2cieYe2YMChkpzvAfN4q6 WxfiqEKeITF1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D7AE69DAB for ; Thu, 26 Feb 2026 13:02:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136163; bh=UYVTE9ygR4x3KhMVXQoi7vBSgF1+v1wJWCFzg7u47K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OaRTzbNbBguy9RRcfPwbNzpqxRv6UeYd5Yx78ZDmfthOHbBNGnkxtVODUzDsxdxwW 7sxitDu4LsE/jqHEnfSCz7OSh1PRbZ5m+ZnDfJb5NvpDhgLMcy6U3q5Vz6KujEN6KA EoNplYn1uJEVxP7FYi3JggNvrDRZOZDu35B0CcyB0F0FNpJUVzoHo5G5KhuCAB6s+f RW/5oLtVgLMzkKMdsSXPXNKnJ1NxE9NOkHe1IMn8b4UPD8dhCwZpuZhWnWc7Hzbp+X UYroBLbA7QQseFx8pAD4QnVEkqzcE6m7kitevdn21wXCZxRGvOdf5hdt6+uf/lSO6P nSMsv6o4+X6sQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C1C669DAB; Thu, 26 Feb 2026 13:02:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id RV1oepM5XbwX; Thu, 26 Feb 2026 13:02:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136158; bh=sFE3kKxoLjuU1sG104w8tq/T6XGMHRo5jvqkuiBaB4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ebq7KjHy8A4SHqvKgFwVHhUpwMLX3ICM3Hhtxej++3fBmKWjIYFEddq3RLwN2ArA6 HjnwHdpTMCRgrKppXrxqCPmCL8wmdSW+dqEXYvXEkP6adcI/o4ub0d2InclksNSj1+ i45RA86jLhoc1mNa3L2OkrJUGTyFPdOngX5++oMRyJUdEoJrOJCj76+hQWSvWi95zu vVeVdoopJGiCUN21QFXmuqGUXxaWZFvLqAzEjgRO8a3suoCXrQ3vEWLvE1YgEbtv9I fkdE8xxaZJzHxlPukPrWR3D8pFnyDH7mwhLWPJdjJXk/9u1Q5HCbkem9fAeGPyXGOO dpza5IgifOgEw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 006E869D79; Thu, 26 Feb 2026 13:02:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:25 -0700 Message-ID: <20260226200106.1727176-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3QZK3OVEHSUNTST4MZTXFFDMKFGNBXS2 X-Message-ID-Hash: 3QZK3OVEHSUNTST4MZTXFFDMKFGNBXS2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/32] patman: Allow setting the upstream when adding a series List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Adding a series always creates it with no upstream, requiring a separate 'set-upstream' command afterwards. Add a -S/--set-upstream option to 'series add' so the upstream can be specified in one step. If the series already exists (e.g. when adding a new version), the upstream is also updated. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 2 ++ tools/patman/control.py | 3 ++- tools/patman/cseries.py | 17 ++++++++++------- tools/patman/test_cseries.py | 17 +++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index f24d0aacdff..57c56b099e1 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -242,6 +242,8 @@ def add_series_subparser(subparsers): add.add_argument( '-f', '--force-version', action='store_true', help='Change the Series-version on a series to match its branch') + add.add_argument('-S', '--set-upstream', + help='Set the upstream for this series') _add_mark(add) _add_allow_unmarked(add) _upstream_add(add) diff --git a/tools/patman/control.py b/tools/patman/control.py index e1f52300a17..7f162b4aadb 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -161,7 +161,8 @@ def do_series(args, test_db=None, pwork=None, cser=None): if args.subcmd == 'add': cser.add(args.series, args.desc, mark=args.mark, allow_unmarked=args.allow_unmarked, end=args.upstream, - use_commit=args.use_first_commit, dry_run=args.dry_run) + use_commit=args.use_first_commit, + ups=args.set_upstream, dry_run=args.dry_run) elif args.subcmd == 'archive': cser.archive(args.series) elif args.subcmd == 'autolink': diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 612ccfda7dc..6369b626035 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -39,7 +39,8 @@ class Cseries(cser_helper.CseriesHelper): super().__init__(topdir, colour) def add(self, branch_name, desc=None, mark=False, allow_unmarked=False, - end=None, use_commit=False, force_version=False, dry_run=False): + end=None, use_commit=False, force_version=False, ups=None, + dry_run=False): """Add a series (or new version of a series) to the database Args: @@ -47,13 +48,13 @@ class Cseries(cser_helper.CseriesHelper): desc (str): Description to use, or None to use the series subject mark (str): True to mark each commit with a change ID allow_unmarked (str): True to not require each commit to be marked - end (str): Add only commits up to but exclu - use_commit (bool)): True to use the first commit's subject as the + end (str): Add only commits up to but excluding this commit + use_commit (bool): True to use the first commit's subject as the series description, if none is available in the series or - provided in 'desc') - + provided in 'desc' force_version (bool): True if ignore a Series-version tag that doesn't match its branch name + ups (str or None): Name of the upstream for this series dry_run (bool): True to do a dry run """ name, ser, version, msg = self.prep_series(branch_name, end) @@ -70,7 +71,7 @@ class Cseries(cser_helper.CseriesHelper): raise ValueError(f"Branch '{name}' has no cover letter - " 'please provide description') if not desc: - desc = ser['cover'][0] + desc = ser.cover[0] # pylint: disable=E1136 ser = self._handle_mark(name, ser, version, mark, allow_unmarked, force_version, dry_run) @@ -80,9 +81,11 @@ class Cseries(cser_helper.CseriesHelper): added = False series_id = self.db.series_find_by_name(ser.name) if not series_id: - series_id = self.db.series_add(ser.name, desc) + series_id = self.db.series_add(ser.name, desc, ups=ups) added = True msg += f" series '{ser.name}'" + elif ups: + self.db.series_set_upstream(series_id, ups) if version not in self._get_version_list(series_id): svid = self.db.ser_ver_add(series_id, version, link) diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index b14c6c22ddc..98acc1de184 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -799,6 +799,7 @@ Tested-by: Mary Smith # yak self.make_git_tree() args = Namespace(subcmd='add', desc='my-description', series='first', mark=False, allow_unmarked=True, upstream=None, + set_upstream=None, use_first_commit=False, dry_run=False) with terminal.capture() as (out, _): control.do_series(args, test_db=self.tmpdir, pwork=True) @@ -823,6 +824,21 @@ Tested-by: Mary Smith # yak 'first my-description ' '-/2 1', lines[2]) + def test_do_series_add_upstream(self): + """Test that series add can set the upstream""" + self.make_git_tree() + args = Namespace(subcmd='add', desc='my-description', series='first', + mark=False, allow_unmarked=True, upstream=None, + set_upstream='origin', + use_first_commit=False, dry_run=False) + with terminal.capture(): + control.do_series(args, test_db=self.tmpdir, pwork=True) + + cser = self.get_database() + slist = cser.db.series_get_dict() + ser = slist.get('first') + self.assertEqual('origin', ser.upstream) + def test_do_series_add_cmdline(self): """Add a new cseries using the cmdline""" self.make_git_tree() @@ -847,6 +863,7 @@ Tested-by: Mary Smith # yak force=True) args = Namespace(subcmd='add', series=None, mark=False, allow_unmarked=True, upstream=None, dry_run=False, + set_upstream=None, desc=None, use_first_commit=False) with terminal.capture(): control.do_series(args, test_db=self.tmpdir, pwork=True) From patchwork Thu Feb 26 20:00:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1957 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136169; bh=p3h7JFBbYapQICReJ6foozM0Yn7OXbstzE4igG01DqM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gzb3hLZve1ljYSvSbHMNbe+GJL1lxtXoCN0z+4xMLhPQeA3+xOje4Oajddu73++33 HLmDfDubABHONXKeJUWbs7cCebglVbzCptfpLXfybpm1odldJKa0k2PL2hoD6/9cng BJQziUX5hGUKE3+EanLYiaSoxf9oqweN2nb6fnsfQBrWgbW98k0nZG9jLHtNoPZGEH lgox1RyVP5XvyaQ3AvdUtLW/kKWEin2oGQO5r1DLiWlQKdte1ZGL9fngzETkPqW1OR BmnmiStLNdEMPxoRSAE7Xyu6cSDmqxU1BE3AHo5GeU5oiEJwFXuLXPQpYmKTKn6tu8 34cpH5RAh+RFA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3165669E3A for ; Thu, 26 Feb 2026 13:02:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id s_4wsDjENrr2 for ; Thu, 26 Feb 2026 13:02:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136169; bh=p3h7JFBbYapQICReJ6foozM0Yn7OXbstzE4igG01DqM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gzb3hLZve1ljYSvSbHMNbe+GJL1lxtXoCN0z+4xMLhPQeA3+xOje4Oajddu73++33 HLmDfDubABHONXKeJUWbs7cCebglVbzCptfpLXfybpm1odldJKa0k2PL2hoD6/9cng BJQziUX5hGUKE3+EanLYiaSoxf9oqweN2nb6fnsfQBrWgbW98k0nZG9jLHtNoPZGEH lgox1RyVP5XvyaQ3AvdUtLW/kKWEin2oGQO5r1DLiWlQKdte1ZGL9fngzETkPqW1OR BmnmiStLNdEMPxoRSAE7Xyu6cSDmqxU1BE3AHo5GeU5oiEJwFXuLXPQpYmKTKn6tu8 34cpH5RAh+RFA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1E24D69E35 for ; Thu, 26 Feb 2026 13:02:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136167; bh=OkqB8Q3Qrv2KnO7MQNVI9q+3uvdYGPOTtZNvsPoUiK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYfqkCAE4Z2qDkB/FMocXG+Itrk7i2uEsiDz4XE9Qb8DzCoR8mDL7jKIN25aA1Qf+ zNoN1rPPxCLmiiqGF1uglrzyKFkBiZNxK1lx+qc2TM0SWRMxMLh7hVAI1AUOyckAYK wZIaKX9H6VVzr6hrCl+n5wsGF2MNL2tY+6p1dKEzJNTLk4vSCaCO7mJL1tskqFsuHJ CLjkVUmHU7PfwteADOC9r3HDza9J7o0WC2UmNxHVbenHX/KXtMk5RJFek0jnLvJZ6p jyoGR8tce+hQlETPMK6f1UfAQy/91+b55qE6h4Yw+gyCRiAAEdDaKL5shoyb+1pDQH ZYyWHWJpekORg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DD3D69E39; Thu, 26 Feb 2026 13:02:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id tCUDIzo9cn1p; Thu, 26 Feb 2026 13:02:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136162; bh=G01Hjxa+6PyOU21q/7qKr4w8dlzMaPke1mWt4rZhZXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SA4WLa4F7pPILHmjXeD06vuAc0hBiLpoyHkaVaTokBkqWGBS2edGdUD+WbwnP1EhF jKMMjNEQ278yJVQjuLh+eXVCvJ+Z23UBLP9sgqYo1eR3WujwlDd+p/LwjGZhms+k+i SpyoVO88Gokdln5fKI/VgYOFlfaluuB6jDIDEfk5QYpwf9UQXVOUXbVvXIazP2plFE npqhomDNEvP1vN7zbs9HV+xK8ajdRhv+5SLbBepXSozzsBpLimdnUbn/7nnDcu1qB2 tqpMF2HrXpqhAJ9Q0aFqKJqNFkFPZ7Ce7r0t801RPcMEKOzd/4Vb0Hk1oZ+UQEabsP rkA8clOj/TZfQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1F3D669D4A; Thu, 26 Feb 2026 13:02:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:26 -0700 Message-ID: <20260226200106.1727176-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XYYTCQIKJKSYT7Y65NIXCTI3OGJQ7QVM X-Message-ID-Hash: XYYTCQIKJKSYT7Y65NIXCTI3OGJQ7QVM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/32] patman: Add 'ls' and 'list' aliases for list subcommands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The series, upstream and patchwork subcommands each have a list command, but use inconsistent names ('ls' for series, 'list' for the others). Add aliases so both 'ls' and 'list' work everywhere. Since argparse stores the alias name rather than the primary name, handle both in the dispatch. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 9 +++++---- tools/patman/control.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 57c56b099e1..3fef37e738d 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -27,10 +27,11 @@ ALIASES = { 'patchwork': ['pw'], 'upstream': ['us'], - # Series aliases + # Subcommand aliases 'archive': ['ar'], 'autolink': ['au'], 'gather': ['g'], + 'ls': ['list'], 'open': ['o'], 'progress': ['p', 'pr', 'prog'], 'rm-version': ['rmv'], @@ -169,7 +170,7 @@ def add_patchwork_subparser(subparsers): uset.add_argument( 'remote', nargs='?', help='Remote to associate with this project') - patchwork_subparsers.add_parser('list') + patchwork_subparsers.add_parser('ls', aliases=['list']) return patchwork @@ -279,7 +280,7 @@ def add_series_subparser(subparsers): series_subparsers.add_parser('get-link') series_subparsers.add_parser('inc') - ls = series_subparsers.add_parser('ls') + ls = series_subparsers.add_parser('ls', aliases=['list']) _add_archived(ls) mar = series_subparsers.add_parser('mark') @@ -429,7 +430,7 @@ def add_upstream_subparser(subparsers): udel.add_argument( 'remote_name', help="Git remote name used for this upstream, e.g. 'us'") - upstream_subparsers.add_parser('list') + upstream_subparsers.add_parser('ls', aliases=['list']) udef = upstream_subparsers.add_parser('default') udef.add_argument('-u', '--unset', action='store_true', help='Unset the default upstream') diff --git a/tools/patman/control.py b/tools/patman/control.py index 7f162b4aadb..352c76bd14e 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -263,7 +263,7 @@ def upstream(args, test_db=None): print(result if result else 'unset') elif args.subcmd == 'delete': cser.upstream_delete(args.remote_name) - elif args.subcmd == 'list': + elif args.subcmd == 'ls': cser.upstream_list() else: raise ValueError(f"Unknown upstream subcommand '{args.subcmd}'") @@ -314,7 +314,7 @@ def patchwork(args, test_db=None, pwork=None): if ups: msg += f" remote '{ups}'" print(msg) - elif args.subcmd == 'list': + elif args.subcmd == 'ls': cser.project_list() else: raise ValueError(f"Unknown patchwork subcommand '{args.subcmd}'") From patchwork Thu Feb 26 20:00:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1958 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136173; bh=iqyzCDPUu/E0PedKNQcHtjH4wW6tIMliglVjCFcb4+4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=O6+DSy0AqWKus2to1TUcpnv7UQrq8t/gdUkuOMjZkBQola574cfRg0KyJ4NYPuTTt LkNifyH32bqkB6U6Dv4FXbwyMW7vcz5dLFglQjkErtq2NBD/wUe645nQ8R2xKhN3yO OGkVYx6LWN/prYCoezZeuQTUuOgSbpcUR0Gv4ovhEuH3qMEx0TlxOk2BWSg0peci/S bPchszdokDo++WrG2O71yEcRMnnXXqCiCWlJLIxiTgNTv2wA0c5zcPvuPaMST0C36N PjbqDKgtc0QFWDgWTaGx5GZbzf0hAWGCen03ny5W8tw4OHEiwTy7eAzOU0tHTHwDUT nYGbExYYl4Q3Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9BFD569E3A for ; Thu, 26 Feb 2026 13:02:53 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D3rQLuVj-eE9 for ; Thu, 26 Feb 2026 13:02:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136173; bh=iqyzCDPUu/E0PedKNQcHtjH4wW6tIMliglVjCFcb4+4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=O6+DSy0AqWKus2to1TUcpnv7UQrq8t/gdUkuOMjZkBQola574cfRg0KyJ4NYPuTTt LkNifyH32bqkB6U6Dv4FXbwyMW7vcz5dLFglQjkErtq2NBD/wUe645nQ8R2xKhN3yO OGkVYx6LWN/prYCoezZeuQTUuOgSbpcUR0Gv4ovhEuH3qMEx0TlxOk2BWSg0peci/S bPchszdokDo++WrG2O71yEcRMnnXXqCiCWlJLIxiTgNTv2wA0c5zcPvuPaMST0C36N PjbqDKgtc0QFWDgWTaGx5GZbzf0hAWGCen03ny5W8tw4OHEiwTy7eAzOU0tHTHwDUT nYGbExYYl4Q3Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8B03169E39 for ; Thu, 26 Feb 2026 13:02:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136171; bh=sR9TDYtJQmAMPxg9z+pZdzP7yphl0qoqLyUzQ0tD3YM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uAIMtNRzBns031OGVjKmdxRHqTlZMQ71h8lAJsD2X8i3rseQu7LPJI4/7RhqTtk/d 0ndazbzrfh/xOzKvT2Ap/7QVVKh6DB7ilEV3DDsK3kqNncU/cJZegrQRBDPsPTn3ry /zLVNqN6vjMJ4Hgw6CkQ+lVikgtB53dxU3tEKpNI+BkUR+rMgplGQVsc8IGBuSeDWw O8wpMh/3AsXdURooBtdqXFek+1qTz9zBj7+yb1agDCAI5D6ESJVIVdD4lIiwPfbHVv RlCUj28rh/rzQDuiid1ixruJ4l8efBgWnJ+CjWI5RQ62tCI9x9+QqRr20/5JtGdDWn 9X4sAgCChoshw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9241969E35; Thu, 26 Feb 2026 13:02:51 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id t7PsOw1yMWSk; Thu, 26 Feb 2026 13:02:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136167; bh=1q9oPFqr8Y5NpbyYF4Lc/CNerbTWA/Ui4qx3FwaUlTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUdug7I9svlxbPyqBmpaxGi+WA7UHnHLeCHj79mE+NWtybGo5fCOQensErc1HPCnr xaTpBQ9N7iAyHdkDuFNrtr4UuPneUeNy0vH0jlO4b3XE6B5pGgZck0CE6LNJLdiuWK ezCZq1mLlkv+84IR6EcmldWytQ+gKXM9VtHkLnGsY0wAB4Cd+V2KX+QH2kwbYIbvob 4IyvUM6E4LyH1zmYoI2gUewkEDvD672KW6O91rIcBE0+IC15K3ylgBXEoClp1af12T 8YIQ+ga7LKmLDX0Ib65Gbiq0DoVwE7umsRyD6WO8ykM4C62FQvAoczOGhie2tRdADG wYBOEj6FQ2IZg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BE75669D52; Thu, 26 Feb 2026 13:02:46 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:27 -0700 Message-ID: <20260226200106.1727176-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MQPHNXZMH4FZUTJUVEUQ4YRS2UWY4KJV X-Message-ID-Hash: MQPHNXZMH4FZUTJUVEUQ4YRS2UWY4KJV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/32] patman: Add per-upstream send settings to the database List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The send settings are already in the v5 schema. Add accessor functions to use them: upstream_get_send_settings() for looking up all settings at once, and upstream_get_identity() for the identity alone. Update upstream_add() to accept send-settings parameters and upstream_get_dict() to return them. This allows different upstreams to use different email configurations. For example, chromium patches can use a different SMTP identity and skip maintainer lookups, while U-Boot patches use the defaults. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 27 ++++++++++++++-- tools/patman/database.py | 62 ++++++++++++++++++++++++++++++++---- tools/patman/test_cseries.py | 9 +++--- 3 files changed, 85 insertions(+), 13 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 6369b626035..871e14458a8 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -932,6 +932,15 @@ class Cseries(cser_helper.CseriesHelper): if not ser.idnum: raise ValueError(f"Series '{ser.name}' not found in database") + if not getattr(args, 'identity', None): + ups = self.get_series_upstream(name) + if ups: + identity = self.db.upstream_get_identity(ups) + if identity: + args.identity = identity + print(f"Using sendemail identity '{identity}'" + f" from upstream '{ups}'") + args.branch = self._get_branch_name(ser.name, version) likely_sent = send.send(args, git_dir=self.gitdir, cwd=self.topdir) @@ -1150,7 +1159,7 @@ class Cseries(cser_helper.CseriesHelper): tout.info('Dry run completed') def upstream_add(self, name, url, project=None, pwork=None, - patchwork_url=None): + patchwork_url=None, identity=None): """Add a new upstream tree Args: @@ -1161,8 +1170,9 @@ class Cseries(cser_helper.CseriesHelper): the project patchwork_url (str or None): URL of the patchwork server for this upstream + identity (str or None): Git sendemail identity to use """ - self.db.upstream_add(name, url, patchwork_url) + self.db.upstream_add(name, url, patchwork_url, identity=identity) if project: if not pwork: if not patchwork_url: @@ -1174,6 +1184,8 @@ class Cseries(cser_helper.CseriesHelper): msg = f"Added upstream '{name}' ({url})" if patchwork_url: msg += f" patchwork '{patchwork_url}'" + if identity: + msg += f" identity '{identity}'" if project: msg += f" project '{project}'" tout.notice(msg) @@ -1187,13 +1199,22 @@ class Cseries(cser_helper.CseriesHelper): udict = self.get_upstream_dict() for name, items in udict.items(): - url, is_default, patchwork_url = items + (url, is_default, patchwork_url, identity, series_to, + no_maintainers, no_tags) = items default = 'default' if is_default else '' proj = self.db.patchwork_get(name) proj_name = proj[0] if proj else '' line = f'{name:10.10} {default:8} {proj_name:20} {url}' if patchwork_url: line += f' pw:{patchwork_url}' + if identity: + line += f' id:{identity}' + if series_to: + line += f' to:{series_to}' + if no_maintainers: + line += ' no-maintainers' + if no_tags: + line += ' no-tags' print(line) def upstream_set_default(self, name): diff --git a/tools/patman/database.py b/tools/patman/database.py index f7ab2d84877..19df3c3bc82 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -791,21 +791,29 @@ class Database: # pylint:disable=R0904 # upstream functions - def upstream_add(self, name, url, patchwork_url=None): + def upstream_add(self, name, url, patchwork_url=None, identity=None, + series_to=None, no_maintainers=False, no_tags=False): """Add a new upstream record Args: name (str): Name of the tree url (str): URL for the tree patchwork_url (str or None): URL of the patchwork server + identity (str or None): Git sendemail identity to use + series_to (str or None): Patman alias for the To address + no_maintainers (bool): True to skip get_maintainer.pl + no_tags (bool): True to skip subject-tag alias processing Raises: ValueError if the name already exists in the database """ try: self.execute( - 'INSERT INTO upstream (name, url, patchwork_url) ' - 'VALUES (?, ?, ?)', (name, url, patchwork_url)) + 'INSERT INTO upstream (name, url, patchwork_url, identity,' + ' series_to, no_maintainers, no_tags) ' + 'VALUES (?, ?, ?, ?, ?, ?, ?)', + (name, url, patchwork_url, identity, series_to, + no_maintainers, no_tags)) except sqlite3.IntegrityError as exc: if 'UNIQUE constraint failed: upstream.name' in str(exc): raise ValueError(f"Upstream '{name}' already exists") from exc @@ -871,6 +879,43 @@ class Database: # pylint:disable=R0904 return rec[0] return None + def upstream_get_identity(self, name): + """Get the sendemail identity for an upstream + + Args: + name (str): Upstream name + + Return: + str or None: Identity name, or None if not set + """ + res = self.execute( + 'SELECT identity FROM upstream WHERE name = ?', (name,)) + rec = res.fetchone() + if rec: + return rec[0] + return None + + def upstream_get_send_settings(self, name): + """Get the send settings for an upstream + + Args: + name (str): Upstream name + + Return: + tuple or None: + str or None: identity + str or None: series_to + bool: no_maintainers + bool: no_tags + """ + res = self.execute( + 'SELECT identity, series_to, no_maintainers, no_tags ' + 'FROM upstream WHERE name = ?', (name,)) + rec = res.fetchone() + if rec: + return rec + return None + def upstream_get_dict(self): """Get a list of upstream entries from the database @@ -881,12 +926,17 @@ class Database: # pylint:disable=R0904 str: url bool: is_default str or None: patchwork_url + str or None: identity + str or None: series_to + bool: no_maintainers + bool: no_tags """ res = self.execute( - 'SELECT name, url, is_default, patchwork_url FROM upstream') + 'SELECT name, url, is_default, patchwork_url, identity,' + ' series_to, no_maintainers, no_tags FROM upstream') udict = OrderedDict() - for name, url, is_default, patchwork_url in res.fetchall(): - udict[name] = url, is_default, patchwork_url + for rec in res.fetchall(): + udict[rec[0]] = rec[1:] return udict # patchwork functions diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 98acc1de184..8f56627958e 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1747,14 +1747,14 @@ Tested-by: Mary Smith # yak cser.upstream_add('us', 'https://one') ulist = cser.get_upstream_dict() self.assertEqual(1, len(ulist)) - self.assertEqual(('https://one', None, None), ulist['us']) + self.assertEqual(('https://one', None, None, None, None, 0, 0), ulist['us']) with terminal.capture(): cser.upstream_add('ci', 'git@two') ulist = cser.get_upstream_dict() self.assertEqual(2, len(ulist)) - self.assertEqual(('https://one', None, None), ulist['us']) - self.assertEqual(('git@two', None, None), ulist['ci']) + self.assertEqual(('https://one', None, None, None, None, 0, 0), ulist['us']) + self.assertEqual(('git@two', None, None, None, None, 0, 0), ulist['ci']) # Try to add a duplicate with self.assertRaises(ValueError) as exc: @@ -1782,7 +1782,8 @@ Tested-by: Mary Smith # yak ulist = cser.get_upstream_dict() self.assertEqual(1, len(ulist)) self.assertEqual( - ('https://one', None, 'https://pw.example.com'), ulist['us']) + ('https://one', None, 'https://pw.example.com', None, None, 0, 0), + ulist['us']) # Check that the patchwork URL shows in the list with terminal.capture() as (out, _): From patchwork Thu Feb 26 20:00:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1959 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136178; bh=6afjNOWHc+1z07vbtzngmBjH19pb/+XqLj/w0OUovEc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wgp2au1cNu9odHkqE0+k8USpT+pSKk4ItFMdiAkkwmCn8Y088bxXe6If3GUoyCyNS UPUzNzS/6Iz8i0GM3lvaemRkYAYzwVoS0/Kk84UsR1BhQWmiaMWlP8IVOeT1cqNhjw 5A1k7sa3OXxOiq9pBeb4jCPgcR5nttgHOeqWU3u43t8v4Lts6WO5Hp1SGKD/OtNGa5 UYjHjnl02/HwMg4J9yJJCU8Au7w42EBhriE+EpBtC26DaOGatdqdWtn+4YgcGJ0VeL DPQ6mQzyR9CypHyRWwwez9GaktsG436FSK2dXdelGUcDQibeu+vd1D848GD6eRKqjR DtOAA3Dnf9l+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 15D6169D4A for ; Thu, 26 Feb 2026 13:02:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2rIp3L55-DOp for ; Thu, 26 Feb 2026 13:02:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136178; bh=6afjNOWHc+1z07vbtzngmBjH19pb/+XqLj/w0OUovEc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wgp2au1cNu9odHkqE0+k8USpT+pSKk4ItFMdiAkkwmCn8Y088bxXe6If3GUoyCyNS UPUzNzS/6Iz8i0GM3lvaemRkYAYzwVoS0/Kk84UsR1BhQWmiaMWlP8IVOeT1cqNhjw 5A1k7sa3OXxOiq9pBeb4jCPgcR5nttgHOeqWU3u43t8v4Lts6WO5Hp1SGKD/OtNGa5 UYjHjnl02/HwMg4J9yJJCU8Au7w42EBhriE+EpBtC26DaOGatdqdWtn+4YgcGJ0VeL DPQ6mQzyR9CypHyRWwwez9GaktsG436FSK2dXdelGUcDQibeu+vd1D848GD6eRKqjR DtOAA3Dnf9l+g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 04F3269E35 for ; Thu, 26 Feb 2026 13:02:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136176; bh=ZzxP/Wocfuvhfk9Qeuh63Qq7yiBM5AjUdSYZmfW6Ma4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbMe19x46fCr19LIym1/jfs23x8V9tL3bwTmwmqoHfb+F2Zho6J6CoC3WAjw6C4QB CR+Jf5AOPEC0UIhondflr2lEWAz7KX5d/Nbv/TbEhe/mnv6hVOnDZTd5J34tZlJMMB rZv6zY8uvdH7+Rw2elDwn7Al1J1NyJhUnof9jm754mNFScyP5i5GSjmZl0rpS/Ik1L i8PsOvgDqRfjc5p4FagYq8VWRy3kuz6hdC5ko1QGjr7v7UecwSgP36tnJvI+zoppuf jo4GXpSng1S72Qh8ghvBkXt4JVjnzasrF5skq3NaP19wqHptBuVawPIU6seZbt4Du3 gN5CslL3Y56Dw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0856969E35; Thu, 26 Feb 2026 13:02:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id dAIwiHq3LWTG; Thu, 26 Feb 2026 13:02:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136171; bh=tienLZxH4BzRFafW61pjq+ZUJeBxuQfruhsShU1vADY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IuoNMuMMeNOqh6Ua4f31tzIEN/MJuG1kgJu3YLE67N5WIzrTsw7L/bmTle65ucXqD 8oQR75RjWpRefs1oB5Nm/RiQCv17lMqAIKWQF2ujrxuQxt35nc2gfWmeWOnVdjhqaF COqWWe1yzDCYn+wfTblwqjEODvnHeHXUiUNx+hEwAGAoY5tRWiSmgECfRhxuqrYjB6 nPoBNwXj+lj6gzB7G+3wAx/kt8KDiQ61MA98HYpu505ymvol6RJVXKU9LrXpC9jODt KjVzJ4iF1wM5bBx844HouUAM36tgrXKqPu8PxbVIdw0cskxYXs+iv2Lul2G3DqG51m 9xo8liNP18SOg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7545369D4A; Thu, 26 Feb 2026 13:02:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:28 -0700 Message-ID: <20260226200106.1727176-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: R2MEEDFJKFY2CR4C22FUMD63COGIKPCD X-Message-ID-Hash: R2MEEDFJKFY2CR4C22FUMD63COGIKPCD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/32] patman: Support sendemail identity and series-to in the send path List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add identity parameter to gitutil.email_patches() and send.email_patches(), passing --identity to git send-email when set. In send.send(), apply series_to from upstream settings: if no Series-to tag is present, use the upstream's configured alias. Warn if the tag does not match the expected value. Signed-off-by: Simon Glass --- tools/patman/send.py | 20 +++++++++++++++++--- tools/u_boot_pylib/gitutil.py | 5 ++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/tools/patman/send.py b/tools/patman/send.py index 08a916aff1a..51d2c533540 100644 --- a/tools/patman/send.py +++ b/tools/patman/send.py @@ -47,7 +47,8 @@ def check_patches(series, patch_files, run_checkpatch, verbose, use_tree, cwd): def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, ignore_bad_tags, add_maintainers, get_maintainer_script, limit, - dry_run, in_reply_to, thread, smtp_server, cwd=None): + dry_run, in_reply_to, thread, smtp_server, identity=None, + cwd=None): """Email patches to the recipients This emails out the patches and cover letter using 'git send-email'. Each @@ -86,6 +87,7 @@ def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, thread (bool): True to add --thread to git send-email (make all patches reply to cover-letter or first patch in series) smtp_server (str): SMTP server to use to send patches (None for default) + identity (str or None): Git sendemail identity to use cwd (str): Path to use for patch files (None to use current dir) Return: @@ -101,7 +103,8 @@ def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, cmd = gitutil.email_patches( series, cover_fname, patch_files, dry_run, not ignore_bad_tags, cc_file, alias=settings.alias, in_reply_to=in_reply_to, - thread=thread, smtp_server=smtp_server, cwd=cwd) + thread=thread, smtp_server=smtp_server, identity=identity, + cwd=cwd) else: print(col.build(col.RED, "Not sending emails due to errors/warnings")) @@ -182,6 +185,16 @@ def send(args, git_dir=None, cwd=None): col, args.branch, args.count, args.start, args.end, args.ignore_binary, args.add_signoff, keep_change_id=args.keep_change_id, git_dir=git_dir, cwd=cwd) + + series_to = getattr(args, 'series_to', None) + if series_to: + to_list = series.get('to', []) + if to_list and series_to not in to_list: + print(f"WARNING: Series-to tag {to_list} does not include " + f"expected '{series_to}' from upstream settings") + if not to_list: + series['to'] = [series_to] + ok = check_patches(series, patch_files, args.check_patch, args.verbose, args.check_patch_use_tree, cwd) @@ -192,6 +205,7 @@ def send(args, git_dir=None, cwd=None): col, series, cover_fname, patch_files, args.process_tags, its_a_go, args.ignore_bad_tags, args.add_maintainers, args.get_maintainer_script, args.limit, args.dry_run, - args.in_reply_to, args.thread, args.smtp_server, cwd=cwd) + args.in_reply_to, args.thread, args.smtp_server, + identity=getattr(args, 'identity', None), cwd=cwd) return cmd and its_a_go and not args.dry_run diff --git a/tools/u_boot_pylib/gitutil.py b/tools/u_boot_pylib/gitutil.py index 34b4dbb4839..c96cd251776 100644 --- a/tools/u_boot_pylib/gitutil.py +++ b/tools/u_boot_pylib/gitutil.py @@ -459,7 +459,7 @@ def check_suppress_cc_config(): def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname, alias, self_only=False, in_reply_to=None, thread=False, - smtp_server=None, cwd=None): + smtp_server=None, identity=None, cwd=None): """Email a patch series. Args: @@ -479,6 +479,7 @@ def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname, thread (bool): True to add --thread to git send-email (make all patches reply to cover-letter or first patch in series) smtp_server (str or None): SMTP server to use to send patches + identity (str or None): Git sendemail identity to use cwd (str): Path to use for patch files (None to use current dir) Returns: @@ -537,6 +538,8 @@ send --cc-cmd cc-fname" cover p1 p2' warn_on_error) cc = [] cmd = ['git', 'send-email', '--annotate'] + if identity: + cmd.append(f'--identity={identity}') if smtp_server: cmd.append(f'--smtp-server={smtp_server}') if in_reply_to: From patchwork Thu Feb 26 20:00:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1960 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136182; bh=tyuwsFEIu8inKGDbgtVDFO+y6sw+MiF1Gp2uVdz3yCU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LH3MdHNpB+YkDIhFLk7F4Elon6B6gQWUXgqx67EoSV8x3xy70Cff7sibyoONb0/Y1 4ZizJDP9C+PP1ROaYVp64MvrHwNARQBoyJ1ZVhjobhUyhDOiAlHBCUqcgo4tNL8z5p GLavIUlIV3Wsex1bJ5E+f9Nq8xPboe52TQzwurBjURVqL8KCtSj6aFvIIiveAg9QM+ K3dJ69jX9rn9EOmHNIZgFQPD/7SpUlxkYV8jM9rd5wgWBQqJ51DQAofsYrlqtxpwo6 nX9je/rvSkgRV2i46MkTtA5vjLOh9KHnWipokCcusqz/bJTIGtacpP5drylVZIdyUF HkYy4F77I8BJg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ED1D969D52 for ; Thu, 26 Feb 2026 13:03:02 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xD5gd7pa5tZM for ; Thu, 26 Feb 2026 13:03:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136182; bh=tyuwsFEIu8inKGDbgtVDFO+y6sw+MiF1Gp2uVdz3yCU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LH3MdHNpB+YkDIhFLk7F4Elon6B6gQWUXgqx67EoSV8x3xy70Cff7sibyoONb0/Y1 4ZizJDP9C+PP1ROaYVp64MvrHwNARQBoyJ1ZVhjobhUyhDOiAlHBCUqcgo4tNL8z5p GLavIUlIV3Wsex1bJ5E+f9Nq8xPboe52TQzwurBjURVqL8KCtSj6aFvIIiveAg9QM+ K3dJ69jX9rn9EOmHNIZgFQPD/7SpUlxkYV8jM9rd5wgWBQqJ51DQAofsYrlqtxpwo6 nX9je/rvSkgRV2i46MkTtA5vjLOh9KHnWipokCcusqz/bJTIGtacpP5drylVZIdyUF HkYy4F77I8BJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DA3EE69E35 for ; Thu, 26 Feb 2026 13:03:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136180; bh=JHHZ2B9K0SzbqH0w3prCMZdSq4w39jvRnAo16Hsxs6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pe5uF4DovlnxvBQThlbPQvJ8V6NragWTTznvVam/vxJHnynAhs79AlFO3OCVHp/lB A6+A2OwnncZnb05Hk8P7PSIHjUrj0x3yFTX+j2cs/slTPzimYD5Bwu54BUi6+BetLJ kpOWW3t6Dr/jgV5ngZMBpW3t/q3WsPPfhDnIY6wl0sp/up+T+YqDjcoecYWUcLyZTn qimdFvz3XecBqnf1eOsQqbgVuLU69R0qEhJs/ipRGilq4UoMjgU+Fr7za3eCivR07K ryb/tzuturkAyMq/LYmRqomgCbTvxg/0RFM6RCtjkcn02UihBIhzDvjsQr7XNnY4XC 7z81abzfLusVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7912769E39; Thu, 26 Feb 2026 13:03:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id KGkFJKTtD6Wx; Thu, 26 Feb 2026 13:03:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136176; bh=3n6jq36BEdLF1sOHV7HO//iwEbicR1AjuoDvKD/0FA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xza+KxK9aMVT0TrC2nVP64tTqRRpFMlDp2UckcUBGvzB03es6coH8WdTTQQOOkfLX apdujgBe62OSkD7HcCrSQcBHKfy/veGZmZQOjVDMNz3MH4i6i8iWoTXksYXcO5ix3t J5b96ob152JvsOP+ws9dg30pZmkzn9+MhlTQPRzULeQA68uedLBrRzlYnWFqM2uK2g IbQl2he19jghWf/Bz1QTLA3X3C8+LbB3/g0WzxbVaCQSqYfTrHgow/MBPPThZCXR55 xaEGPj45nWGKClaTUYHTgcw/FKMw/CEN2NrmAu3N8x4EUZE0x2T0djINz2Tn0spbL6 9YsboLDl7WIdA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BB50269D52; Thu, 26 Feb 2026 13:02:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:29 -0700 Message-ID: <20260226200106.1727176-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: A6MF26TUEREV7HZWCFXWO2N4YI7S5KEK X-Message-ID-Hash: A6MF26TUEREV7HZWCFXWO2N4YI7S5KEK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 23/32] patman: Wire up per-upstream send settings in commands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add -I/--identity, -t/--series-to, -m/--no-maintainers and --no-tags options to 'upstream add' and thread them through to the database. In cseries.send(), look up the series' upstream send settings and apply them to args before sending: set identity, series_to, add_maintainers and process_tags as appropriate. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 12 ++++++++++++ tools/patman/control.py | 6 +++++- tools/patman/cseries.py | 34 +++++++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 3fef37e738d..6141f106fde 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -423,6 +423,18 @@ def add_upstream_subparser(subparsers): '-p', '--patchwork-url', help='URL of patchwork server for this upstream, e.g. ' "'https://patchwork.ozlabs.org'") + uadd.add_argument( + '-I', '--identity', + help="Git sendemail identity to use, e.g. 'chromium'") + uadd.add_argument( + '-t', '--series-to', + help="Patman alias for the To address, e.g. 'u-boot'") + uadd.add_argument( + '-m', '--no-maintainers', action='store_true', default=False, + help='Skip get_maintainer.pl for this upstream') + uadd.add_argument( + '--no-tags', action='store_true', default=False, + help='Skip subject-tag alias processing for this upstream') uadd.add_argument( 'project_name', nargs='?', help="Patchwork project name, e.g. 'U-Boot'") diff --git a/tools/patman/control.py b/tools/patman/control.py index 352c76bd14e..689fd732dec 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -252,7 +252,11 @@ def upstream(args, test_db=None): if args.subcmd == 'add': cser.upstream_add(args.remote_name, args.url, args.project_name, - patchwork_url=args.patchwork_url) + patchwork_url=args.patchwork_url, + identity=args.identity, + series_to=args.series_to, + no_maintainers=args.no_maintainers, + no_tags=args.no_tags) elif args.subcmd == 'default': if args.unset: cser.upstream_set_default(None) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 871e14458a8..36f0b432073 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -932,14 +932,21 @@ class Cseries(cser_helper.CseriesHelper): if not ser.idnum: raise ValueError(f"Series '{ser.name}' not found in database") - if not getattr(args, 'identity', None): - ups = self.get_series_upstream(name) - if ups: - identity = self.db.upstream_get_identity(ups) - if identity: + ups = self.get_series_upstream(name) + if ups: + settings = self.db.upstream_get_send_settings(ups) + if settings: + identity, series_to, no_maintainers, no_tags = settings + if identity and not getattr(args, 'identity', None): args.identity = identity print(f"Using sendemail identity '{identity}'" f" from upstream '{ups}'") + if series_to: + args.series_to = series_to + if no_maintainers: + args.add_maintainers = False + if no_tags: + args.process_tags = False args.branch = self._get_branch_name(ser.name, version) likely_sent = send.send(args, git_dir=self.gitdir, cwd=self.topdir) @@ -1159,7 +1166,8 @@ class Cseries(cser_helper.CseriesHelper): tout.info('Dry run completed') def upstream_add(self, name, url, project=None, pwork=None, - patchwork_url=None, identity=None): + patchwork_url=None, identity=None, series_to=None, + no_maintainers=False, no_tags=False): """Add a new upstream tree Args: @@ -1171,8 +1179,14 @@ class Cseries(cser_helper.CseriesHelper): patchwork_url (str or None): URL of the patchwork server for this upstream identity (str or None): Git sendemail identity to use + series_to (str or None): Patman alias for the To address + no_maintainers (bool): True to skip get_maintainer.pl + no_tags (bool): True to skip subject-tag alias processing """ - self.db.upstream_add(name, url, patchwork_url, identity=identity) + self.db.upstream_add(name, url, patchwork_url, identity=identity, + series_to=series_to, + no_maintainers=no_maintainers, + no_tags=no_tags) if project: if not pwork: if not patchwork_url: @@ -1186,6 +1200,12 @@ class Cseries(cser_helper.CseriesHelper): msg += f" patchwork '{patchwork_url}'" if identity: msg += f" identity '{identity}'" + if series_to: + msg += f" to '{series_to}'" + if no_maintainers: + msg += ' no-maintainers' + if no_tags: + msg += ' no-tags' if project: msg += f" project '{project}'" tout.notice(msg) From patchwork Thu Feb 26 20:00:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1961 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136187; bh=6a3SKaawCR+gGsKOwax37g+u1x+54ddQenjvBstwLpw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fMyK4XzS2yio8u5r3fjyJoPNBk8Zh60TgEUcK0zJ7CXyaUGIT5b2IZJIBUkSuyJ2Q wRumiwnjHyjTH/tbgyMtyWiPZuVI7r2BpRctCY3CbhEE1GIRPrp5u868uf6feNGpfm aC2r5JnZbTptm2Kg4svaIXFvlo0cTEhMRQk4iXSZ+2q6IBxBRjJsvx+9ZFaMXUmAac mYhIMYFm06sRb2usa1Yv3i5mLUroqVv7ZMVWmQ3FqKDjNNwgdx7DIbfTM6gfK0sH9G 1Ra9b02Pv3ZqIUAGs4pYRw0Jm/hnLbUvDctRoVpssoKTnYpIocaKyd7XWbvQkMW4jf rZk6Z4pEp1MQQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 732D269D4A for ; Thu, 26 Feb 2026 13:03:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hTd5ml0cUkWK for ; Thu, 26 Feb 2026 13:03:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136187; bh=6a3SKaawCR+gGsKOwax37g+u1x+54ddQenjvBstwLpw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fMyK4XzS2yio8u5r3fjyJoPNBk8Zh60TgEUcK0zJ7CXyaUGIT5b2IZJIBUkSuyJ2Q wRumiwnjHyjTH/tbgyMtyWiPZuVI7r2BpRctCY3CbhEE1GIRPrp5u868uf6feNGpfm aC2r5JnZbTptm2Kg4svaIXFvlo0cTEhMRQk4iXSZ+2q6IBxBRjJsvx+9ZFaMXUmAac mYhIMYFm06sRb2usa1Yv3i5mLUroqVv7ZMVWmQ3FqKDjNNwgdx7DIbfTM6gfK0sH9G 1Ra9b02Pv3ZqIUAGs4pYRw0Jm/hnLbUvDctRoVpssoKTnYpIocaKyd7XWbvQkMW4jf rZk6Z4pEp1MQQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 60B9269E35 for ; Thu, 26 Feb 2026 13:03:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136185; bh=OfStY4rFi12SfZZEcVV6KSAfyVb8y8TskoHv7LhsZes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cJDwmU5qtqSPv1l1b1kpuf0UAFYdTHeNqIbGBm+VpB4Ci4cBp6M0kk+ciFGsuTbIl FmtrbRVKEkL6vlqeKTz7z6fbsIuxf6QiL+tTYxIY4y9JAtwOy365x624Qn+JVUJRjL VvlGYUr0mocqg0SkypZGrV7dzpX/Vq+Y4Si8lPMQ6MVpME6n2VXp4SYX7Vk6NnXlrl kIPhT+SNHrnGI2dOmFET3d/BTnA7mRq/6EO+vZpTWTiEgYPTf1yb7jM7BnIDLfP/Ac 9XRfTPvW+K2UhcyEAbGQhVCXs4bDLlYpoZQypE7L0VJWoB30oKShMuiByzLekSS6I4 uV3Tr5Dq5x3WQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A1B269E35; Thu, 26 Feb 2026 13:03:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id uSJUIwpyRrRL; Thu, 26 Feb 2026 13:03:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136180; bh=91Yekz1qh1b9FKr4w45j3LTm2/9489uFMrES9egkHY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K4N5oUtyz9UAiMa9CHs9Lj4tQNxiN+/PQILkg3tAer+OLFQiSvmG4SyqjsAv6/5bx rCixcLpIJOJXM9nxCB44BNXLS+OaJwBAAQxArLYil83wEyhgfJIJWphPwRn5dL5oAA C/BD+2IGFrVTmz8o4fKo1dTy7RK5OOCHWIDtJFGI3jEkbCaO7HTJ+cohbkOktgG2Si lrKWYnV0BiFAwV85OghmdULpu+wdcX2eas+SJeqfdz1iYAobkBADenYEufJGLuvV7m ioUMpXDQhX8U4irvid79+aXkKjNh47vyOYFv09uFLwJlIqngmkA2QxPLLF6SUmEQt5 5II+s+VIsv/6w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7129C69D4A; Thu, 26 Feb 2026 13:03:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:30 -0700 Message-ID: <20260226200106.1727176-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4VASACJBDQNWDEFXRVFOJPC5WBVQX3CY X-Message-ID-Hash: 4VASACJBDQNWDEFXRVFOJPC5WBVQX3CY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 24/32] patman: Add an 'upstream set' command to update settings List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a 'set' subcommand for upstream that allows updating individual fields on an existing upstream without having to delete and re-add it. Supports -p/--patchwork-url, -I/--identity, -t/--series-to, -m/--no-maintainers, --maintainers, --no-tags and --tags. For example: patman upstream set us -I chromium -t concept -m Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 25 ++++++++++++++++++ tools/patman/control.py | 19 ++++++++++++++ tools/patman/cseries.py | 14 ++++++++++ tools/patman/database.py | 34 ++++++++++++++++++++++++ tools/patman/test_cseries.py | 50 ++++++++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 6141f106fde..5bf917e4712 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -411,6 +411,7 @@ def add_upstream_subparser(subparsers): upstream.defaults_cmds = [ ['add', 'us', 'http://fred', '-p', 'http://pw', 'U-Boot'], ['delete', 'us'], + ['set', 'us'], ] upstream_subparsers = upstream.add_subparsers(dest='subcmd') uadd = upstream_subparsers.add_parser('add') @@ -443,6 +444,30 @@ def add_upstream_subparser(subparsers): 'remote_name', help="Git remote name used for this upstream, e.g. 'us'") upstream_subparsers.add_parser('ls', aliases=['list']) + uset = upstream_subparsers.add_parser('set') + uset.add_argument('remote_name', + help="Git remote name used for this upstream, e.g. 'us'") + uset.add_argument( + '-p', '--patchwork-url', + help='URL of patchwork server for this upstream') + uset.add_argument( + '-I', '--identity', + help="Git sendemail identity to use, e.g. 'chromium'") + uset.add_argument( + '-t', '--series-to', + help="Patman alias for the To address, e.g. 'u-boot'") + uset.add_argument( + '-m', '--no-maintainers', action='store_true', default=None, + help='Skip get_maintainer.pl for this upstream') + uset.add_argument( + '--maintainers', action='store_true', default=None, + help='Enable get_maintainer.pl for this upstream') + uset.add_argument( + '--no-tags', action='store_true', default=None, + help='Skip subject-tag alias processing for this upstream') + uset.add_argument( + '--tags', action='store_true', default=None, + help='Enable subject-tag alias processing for this upstream') udef = upstream_subparsers.add_parser('default') udef.add_argument('-u', '--unset', action='store_true', help='Unset the default upstream') diff --git a/tools/patman/control.py b/tools/patman/control.py index 689fd732dec..cabd2138bb3 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -267,6 +267,25 @@ def upstream(args, test_db=None): print(result if result else 'unset') elif args.subcmd == 'delete': cser.upstream_delete(args.remote_name) + elif args.subcmd == 'set': + kwargs = {} + if args.patchwork_url is not None: + kwargs['patchwork_url'] = args.patchwork_url + if args.identity is not None: + kwargs['identity'] = args.identity + if args.series_to is not None: + kwargs['series_to'] = args.series_to + if args.no_maintainers: + kwargs['no_maintainers'] = True + elif args.maintainers: + kwargs['no_maintainers'] = False + if args.no_tags: + kwargs['no_tags'] = True + elif args.tags: + kwargs['no_tags'] = False + if not kwargs: + raise ValueError('No settings to update') + cser.upstream_set(args.remote_name, **kwargs) elif args.subcmd == 'ls': cser.upstream_list() else: diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 36f0b432073..588e83298bd 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -1237,6 +1237,20 @@ class Cseries(cser_helper.CseriesHelper): line += ' no-tags' print(line) + def upstream_set(self, name, **kwargs): + """Update settings on an existing upstream + + See Database.upstream_set() for permitted kwargs. + + Args: + name (str): Name of the upstream remote to update + kwargs: Fields to update + """ + self.db.upstream_set(name, **kwargs) + self.commit() + parts = [f'{k}={v!r}' for k, v in kwargs.items()] + tout.notice(f"Updated upstream '{name}': {', '.join(parts)}") + def upstream_set_default(self, name): """Set the default upstream target diff --git a/tools/patman/database.py b/tools/patman/database.py index 19df3c3bc82..dcd39ea2c69 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -863,6 +863,40 @@ class Database: # pylint:disable=R0904 self.rollback() raise ValueError(f"No such upstream '{name}'") + def upstream_set(self, name, **kwargs): + """Update fields on an existing upstream + + Args: + name (str): Name of the upstream remote to update + kwargs: Fields to update, each being one of: + patchwork_url (str): URL of the patchwork server, e.g. + 'patchwork.ozlabs.org' + identity (str): Git sendemail identity to use when + sending, corresponding to a [sendemail ""] + section in .gitconfig + series_to (str): Mailing-list address to use as the + default To: for this upstream + no_maintainers (bool): True to skip + get_maintainer.pl when sending + no_tags (bool): True to skip processing of subject + tags (e.g. 'dm:') when sending + + Raises: + ValueError: Upstream does not exist or invalid field + """ + valid = {'patchwork_url', 'identity', 'series_to', + 'no_maintainers', 'no_tags'} + invalid = set(kwargs) - valid + if invalid: + raise ValueError(f"Invalid upstream field(s): {invalid}") + for field, value in kwargs.items(): + self.execute( + f'UPDATE upstream SET {field} = ? WHERE name = ?', + (value, name)) + if self.rowcount() != 1: + self.rollback() + raise ValueError(f"No such upstream '{name}'") + def upstream_get_patchwork_url(self, name): """Get the patchwork URL for an upstream diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 8f56627958e..fcfe6610321 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1813,6 +1813,56 @@ Tested-by: Mary Smith # yak 'us https://one', lines[0]) + def test_upstream_set(self): + """Test updating settings on an existing upstream""" + cser = self.get_cser() + + with terminal.capture(): + cser.upstream_add('us', 'https://one') + + # Set identity and series_to + with terminal.capture(): + cser.upstream_set('us', identity='chromium', series_to='concept') + settings = cser.db.upstream_get_send_settings('us') + self.assertEqual('chromium', settings[0]) + self.assertEqual('concept', settings[1]) + + # Set boolean flags + with terminal.capture(): + cser.upstream_set('us', no_maintainers=True, no_tags=True) + settings = cser.db.upstream_get_send_settings('us') + self.assertTrue(settings[2]) + self.assertTrue(settings[3]) + + # Clear boolean flags + with terminal.capture(): + cser.upstream_set('us', no_maintainers=False, no_tags=False) + settings = cser.db.upstream_get_send_settings('us') + self.assertFalse(settings[2]) + self.assertFalse(settings[3]) + + # Non-existent upstream + with self.assertRaises(ValueError) as exc: + cser.upstream_set('nonexistent', identity='x') + self.assertIn('nonexistent', str(exc.exception)) + + def test_upstream_set_cmdline(self): + """Test upstream set via the command line""" + with terminal.capture(): + self.run_args('upstream', 'add', 'us', 'https://one') + + with terminal.capture(): + self.run_args('upstream', 'set', 'us', '-I', 'chromium', + '-t', 'concept', '-m', '--no-tags') + + with terminal.capture() as (out, _): + self.run_args('upstream', 'list') + line = out.getvalue().strip() + self.assertIn('id:chromium', line) + self.assertIn('to:concept', line) + self.assertIn('no-maintainers', line) + self.assertIn('no-tags', line) + def test_upstream_default(self): """Operation of the default upstream""" cser = self.get_cser() From patchwork Thu Feb 26 20:00:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1962 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136191; bh=qPZIP8v5r/i13WfmhBKMFg8IbGZ1q8GnuTNvkk1KWSk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uZOg7BjYgsSL32PNYBQt7Klk37ftR6Ga4piKdRSQ6+dLPFyza5ifMDnKqL9pcg4LS XEypsXkAQh2T3rCwfnFMk1HsDHt3hbOSjmZ3+9FH04L/QOEU/Dc4RP/0e8KjxifRTs auX+tdwJJLIjqxSAAy6egyrKp9Au1vbrXuaby5YRii7DVSbVlh84ZztiFF0yUMm5ZK 9muFArH0Z+AKwF0dLwn+uNNWVddYeSFDGXXZrKJbADHwZrg/6u1u44CyB/FcQaZcTT 0X52Rb6AjvkvzD41J4fzibtuqoKURX7bNzoBa/GYF87Y8EnmJnZQ8Ldeb1mlcI4O2T DPOqtU2tQmReQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D422869E3F for ; Thu, 26 Feb 2026 13:03:11 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Rtmk6Odjxrha for ; Thu, 26 Feb 2026 13:03:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136191; bh=qPZIP8v5r/i13WfmhBKMFg8IbGZ1q8GnuTNvkk1KWSk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uZOg7BjYgsSL32PNYBQt7Klk37ftR6Ga4piKdRSQ6+dLPFyza5ifMDnKqL9pcg4LS XEypsXkAQh2T3rCwfnFMk1HsDHt3hbOSjmZ3+9FH04L/QOEU/Dc4RP/0e8KjxifRTs auX+tdwJJLIjqxSAAy6egyrKp9Au1vbrXuaby5YRii7DVSbVlh84ZztiFF0yUMm5ZK 9muFArH0Z+AKwF0dLwn+uNNWVddYeSFDGXXZrKJbADHwZrg/6u1u44CyB/FcQaZcTT 0X52Rb6AjvkvzD41J4fzibtuqoKURX7bNzoBa/GYF87Y8EnmJnZQ8Ldeb1mlcI4O2T DPOqtU2tQmReQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C339F69E35 for ; Thu, 26 Feb 2026 13:03:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136189; bh=qlbealrWbY+4XVmg+1pk7B+qH2ujicwYL8chjSUA+gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzQfrRc64aV4hGRYzEmdw2T09UViRSLzx1WOjenYdEEARABI5saBrym8AiTh3GSpc OQQhrjMak3iZiDTLp6cKxZXs3n5fC2SbuwiyAp0Ys3Izq+YwUKzVaPtjCXW6eRTfJo EkHpYcmQj7JrtOzb40q1xZ+FY9K2IKlo+M8Xe1tn6TZg5Sik57QsZuAVd5lBkk1uoP 4CgeGWapR80Km5QFGPl3dy5AcHf9AOFVjTJfdWnnWvmi1xT0KK2tSUmDxr14KmNUM3 oQXv/+rMCdO9h8qVXCIX9JLj8tplQCwaBr0YBjTc+xcP+usyOw8axtrK81AsTn0+GT J9trsrqY3+6+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CD15269E35; Thu, 26 Feb 2026 13:03:09 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 9p_4S_CW8X0n; Thu, 26 Feb 2026 13:03:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136185; bh=0IWnYpNPdprwILzSbWgj9Z0LJVlIhebnwquoncZfNu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lPb4qWGhCMyNtDvwgwEu7C+XyyAxwQDmWNxudiWUfm/3JSML7LBTGQgLSnEupyoq9 AoGqVeO8LgOm8hDelrJ8k8wM0ICCeDkdObH+p1gh+G3+KQQHfZHw6LYl9XU2Aal/W8 j1byIl+p0Did1D2Inhb3CsjOlsE3A/vIl3g4ZAMdf1mSKbW92jt6qWGMb3yRpe/oXH LMrLrPm/20PREVHPlBRjKtblYH5ithWuY67DeHgAgncpYJ8FMphK4sracgrjE4fG4R BJwhwR1IByGzkEoHNdF92qtALuUQpSKCR3t3Arxe+ZSpdZd47mnh6mptFF3skJxOMF 9UF5ZDFmM21Nw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2E6A169D52; Thu, 26 Feb 2026 13:03:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:31 -0700 Message-ID: <20260226200106.1727176-26-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NQH2HDWHLWBNL3HGVLTV2DFP5CZJD3QM X-Message-ID-Hash: NQH2HDWHLWBNL3HGVLTV2DFP5CZJD3QM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 25/32] patman: Use notice() for database migration messages List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Use tout.notice() instead of tout.info() so that migration messages are visible at the default verbosity level. Signed-off-by: Simon Glass --- tools/patman/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/database.py b/tools/patman/database.py index dcd39ea2c69..a5952c6d2b6 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -214,7 +214,7 @@ class Database: # pylint:disable=R0904 tools.read_file(self.db_path)) version += 1 - tout.info(f'Update database to v{version}') + tout.notice(f'Update database to v{version}') self.open_it() if version == 1: self.create_v1() From patchwork Thu Feb 26 20:00:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1963 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136196; bh=AyTNgvn/slpVX8cVjj4G6wKRBbUn5p4WDqzsxsYzqds=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GziW1X0Xf7fg05IkIjs+WbxvGC0yld/sqULFUM73wBRb0b+rd48OhMmLSQYQnJ/iJ bIVXbstcvJTlOB28o81qeh8A0dI4g0N/CRljPiyQtaaurJg3Y6kgdFej7qb4EvCghG +Xkf0znETSu6lpwY5SYzBElz2BWbs1r86FpLUzNH+dU2MQzQ9ALwZBb66ACUukHUil SG6ruv2hjblDBasJZgJfAMIjDTxI83rpFGsGmxTgkfpCYLYm3M2OmKedNFBxUub1dF ugGeN6cahAl1RyFkgTSLVB37k+9nfzvRtlB9qmKklKbsnqyRjPGWUfl/4mWD4lOPsZ 9zaYLOB/nsbXQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4446F69D4A for ; Thu, 26 Feb 2026 13:03:16 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gnShxkfoQFji for ; Thu, 26 Feb 2026 13:03:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136196; bh=AyTNgvn/slpVX8cVjj4G6wKRBbUn5p4WDqzsxsYzqds=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GziW1X0Xf7fg05IkIjs+WbxvGC0yld/sqULFUM73wBRb0b+rd48OhMmLSQYQnJ/iJ bIVXbstcvJTlOB28o81qeh8A0dI4g0N/CRljPiyQtaaurJg3Y6kgdFej7qb4EvCghG +Xkf0znETSu6lpwY5SYzBElz2BWbs1r86FpLUzNH+dU2MQzQ9ALwZBb66ACUukHUil SG6ruv2hjblDBasJZgJfAMIjDTxI83rpFGsGmxTgkfpCYLYm3M2OmKedNFBxUub1dF ugGeN6cahAl1RyFkgTSLVB37k+9nfzvRtlB9qmKklKbsnqyRjPGWUfl/4mWD4lOPsZ 9zaYLOB/nsbXQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 328FE69E35 for ; Thu, 26 Feb 2026 13:03:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136194; bh=ZCoqVTd4GDrlSxDF8gY/PUmLcHgizPNbNA7q3FDUUHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJsu9F7HT8zCwjj4Oh5uim8uzsLGjKFlTlpqOf0cMAIZT6tNByoZUuIojMrwZQ1XW dZ6NUdE/Qx+5zztR+taA8LRUN6az0/omV35oeq0Z+CckEGRjS0KW1knWCC39sFOhAK SkgLY3BSo4k/Zv/9uLvy1++yblZsq+/NSGAVyh+PeYSZB9tM2mIIxQeFOvrBInTmIe gvz7hn7K8ReVuARGFa+ru8wz7t9BqMDH6Wly7j1aeW3N5CI8ydPZGezfNpBtlPW6pN cjWpZa7gA5EvGvyEnmIEdxV2TASCt9W83z3rqDwUUuSHRVfVExjb4kxRReRgESUURs 9C3awgiV5gdeQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3450469E35; Thu, 26 Feb 2026 13:03:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id xzYo8kqwOrVg; Thu, 26 Feb 2026 13:03:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136189; bh=e/B0HfjVxEMZK/ZQoypp5CFOeb3iTs9fR/7bWHuOVH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r6tbxGNPX7zZ3+cCBfmofKJp+O7KVt43SrUhS4lJpV7CMz5q8Jtg4eCrt5ZyTrvkR Vjwxj4btJJ2DRjZg+lMVmUAeDHLlUWcuUki0MWztSE0N9SxkY7cytfPnL5mPhWWCv+ 095kMFlAUU2Jb8f+DTngiYix/7Gr8UpTOCjQ/XGcRMwtaCju1oqLoN82wXP3tjfILz 8VAcLH2PktrVOXqFXMpSAKEzpNRdRXz52u/0V8ZhwOl7n8U4jl9cAe9xvXxGyYHJK9 +WvAOtaDDR0MRKTQ47X+N4npfTElg4OZ503JLb+lxzF97fcvm/hr+IjMu1btZzuyRA SCB52IZJk/PAw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 86DA569D4A; Thu, 26 Feb 2026 13:03:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:32 -0700 Message-ID: <20260226200106.1727176-27-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TWM7JNDBR4HFXCGDX2ZIFSDSNYMLBVBA X-Message-ID-Hash: TWM7JNDBR4HFXCGDX2ZIFSDSNYMLBVBA X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 26/32] patman: Add header and tidy columns in upstream list List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a header row and separator to 'upstream list' output, matching the style used by 'series ls'. Use narrower columns and show the default upstream with '*' instead of 'default'. Collect optional fields (patchwork URL, identity, series-to, flags) into an Options column. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 21 +++++++++++++-------- tools/patman/test_cseries.py | 35 ++++++++++++++--------------------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 588e83298bd..47da57acc0f 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -1218,24 +1218,29 @@ class Cseries(cser_helper.CseriesHelper): """ udict = self.get_upstream_dict() + print(f"{'Name':6} {'Def':3} {'Project':10} {'URL':40} Options") + border = (f"{'-' * 6} {'-' * 3} {'-' * 10} {'-' * 40} " + f"{'-' * 20}") + print(border) for name, items in udict.items(): (url, is_default, patchwork_url, identity, series_to, no_maintainers, no_tags) = items - default = 'default' if is_default else '' + default = '*' if is_default else '' proj = self.db.patchwork_get(name) proj_name = proj[0] if proj else '' - line = f'{name:10.10} {default:8} {proj_name:20} {url}' + opts = [] if patchwork_url: - line += f' pw:{patchwork_url}' + opts.append(f'pw:{patchwork_url}') if identity: - line += f' id:{identity}' + opts.append(f'id:{identity}') if series_to: - line += f' to:{series_to}' + opts.append(f'to:{series_to}') if no_maintainers: - line += ' no-maintainers' + opts.append('no-maintainers') if no_tags: - line += ' no-tags' - print(line) + opts.append('no-tags') + print(f'{name:6} {default:3} {proj_name:10} {url:40} ' + f'{" ".join(opts)}') def upstream_set(self, name, **kwargs): """Update settings on an existing upstream diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index fcfe6610321..3d475956ff9 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1764,13 +1764,10 @@ Tested-by: Mary Smith # yak with terminal.capture() as (out, _): cser.upstream_list() lines = out.getvalue().splitlines() - self.assertEqual(2, len(lines)) - self.assertEqual( - 'us https://one', - lines[0]) - self.assertEqual( - 'ci git@two', - lines[1]) + self.assertEqual(4, len(lines)) + self.assertIn('Name', lines[0]) + self.assertIn('https://one', lines[2]) + self.assertIn('git@two', lines[3]) def test_upstream_add_patchwork_url(self): """Test adding an upstream with a patchwork URL""" @@ -1789,8 +1786,8 @@ Tested-by: Mary Smith # yak with terminal.capture() as (out, _): cser.upstream_list() lines = out.getvalue().splitlines() - self.assertEqual(1, len(lines)) - self.assertIn('pw:https://pw.example.com', lines[0]) + self.assertEqual(3, len(lines)) + self.assertIn('pw:https://pw.example.com', lines[2]) # Check database lookup pw_url = cser.db.upstream_get_patchwork_url('us') @@ -1808,10 +1805,9 @@ Tested-by: Mary Smith # yak with terminal.capture() as (out, _): self.run_args('upstream', 'list') lines = out.getvalue().splitlines() - self.assertEqual(1, len(lines)) - self.assertEqual( - 'us https://one', - lines[0]) + self.assertEqual(3, len(lines)) + self.assertIn('us', lines[2]) + self.assertIn('https://one', lines[2]) def test_upstream_set(self): """Test updating settings on an existing upstream""" @@ -1891,13 +1887,9 @@ Tested-by: Mary Smith # yak with terminal.capture() as (out, _): cser.upstream_list() lines = out.getvalue().splitlines() - self.assertEqual(2, len(lines)) - self.assertEqual( - 'us https://one', - lines[0]) - self.assertEqual( - 'ci default git@two', - lines[1]) + self.assertEqual(4, len(lines)) + self.assertNotIn('*', lines[2]) + self.assertIn('*', lines[3]) cser.upstream_set_default(None) self.assertIsNone(cser.upstream_get_default()) @@ -1982,7 +1974,8 @@ Tested-by: Mary Smith # yak self.run_args('upstream', 'delete', 'ci') with terminal.capture() as (out, _): self.run_args('upstream', 'list') - self.assertFalse(out.getvalue().strip()) + lines = out.getvalue().splitlines() + self.assertEqual(2, len(lines)) def test_series_upstream(self): """Test upstream field in the series table""" From patchwork Thu Feb 26 20:00:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1964 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136200; bh=/48Ul1PSIc5zM2upiPUR1RmCVWcedGpF9I07MVLGYhg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZXM8EtDwb+pBbQdaieDrxlUUOhyKr2M06uSv8cHwjurDLNJ5L0ihwxluo/Q+uNR2T hlQN6q25ghdsz2Ncj6TsDkyMLb5zGI4VorsTNPyioOmULeLCcA3ZChKZo8qpUr+xWe xK0axXSWwg2WocKXLvZV0Oy7+XS39JlfSwb84CbhQtvM+Lzk5PTaZvhd8ha055gbOf W8ri4W0cYCw7OaOeEwv/mhk/MzCsLU5MAkOVytoLSNx5isLZqsYBWwjVL2mSvi8B8R 4fkTQn61LY6Q1fqpvBzA8NNRDqm1dupn+WzwLZ+L0qzrBqmrezYhnAs0v3uWzuoj2a ldHRepsz0JWuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C30269E3F for ; Thu, 26 Feb 2026 13:03:20 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Blmg1WrQxNsM for ; Thu, 26 Feb 2026 13:03:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136199; bh=/48Ul1PSIc5zM2upiPUR1RmCVWcedGpF9I07MVLGYhg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dSWJP3qVpRwhPfxkyZySdsRGw6GlydN0sCANzRxQrqvp68CFZyZzlP1tzl/VtS1rE WTKxEicjpayaqpZq4ee7mMMPoPop9uSZIDg61vBdWSSLbIaXxbttY3umyx1FCDHq+M e4tk6giNIUP0MEkKkC05me+KAXM5vbVlrI/JDXJBsl2w9/2aXmQvg/Z+yoLHRPKXpo D4GCJ8OH1HjHqCtA3xQKx8dzcArRlBo7U8C/kAYwyLcI0UupaP1ZRq7WuT0KwQisFd NarUzK53MsoHUQdd+2kJAirAqtxsqNNmp8ey2l7MLyVM19f6izE++CWXzgvR8qjXes OnRPTTZI+mWsA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E8D7769E39 for ; Thu, 26 Feb 2026 13:03:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136198; bh=CS9o2xmNloYWB+ydredPxpcDohX//kukM6M3HYgqhlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vX7fRxGZoNEnhNiWvw9GXUvNS6/0cRZBLCiDb0k8b5ZgJsLtWMayyml/CafLe8waa VjQsjZ7Y4qd7LfSBnywidbnla32k+5/+hXJ1bydEO/GDrSQqCprrP+XnhR128L6B4Z WiKjwdYgUwFkoTOf2W0+42895/NAR3x7/NG+DoLOFkzHMxkbWcuFgySvYTUfTEmkkW 8LtqVGkiiWJlUbNnP0qKsZ3yBnoO4cqHauckJSw9RmB48FCWo7v4kgEFpbdlR6aap4 dSKp79v9IxS5Q2fv08Rb8iVbL4EjypJRk/P43MuJWgqUgyitOZy8wBQ8menL2fKJJO zBaP9t9B++Rmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8DBD669E4B; Thu, 26 Feb 2026 13:03:18 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 6EpcVS4_AoPx; Thu, 26 Feb 2026 13:03:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136194; bh=RyiuYiXcrgJ5mnZmlJuD1gqd9hmSw6qbHzyM+sWWifk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ulnUmh3GmklUTLdtm1RRaxr/9aIGJySe/NUISRiiEzMEkceGb46G5ZCnFL1xsAudr p8BLBBmahTCvnJ6ptQ3CsfmFAVpjYjy0cTyvEFWoHYjVVQLiFeD9TR/hPdAAkyUhUD rssDVBGTypDClqYwHBdYZwsDfs3IzjpADDa3hs5bG+iF5YD7q9KPzGlbCHbVOPq+uu W0vf5Po4cDyw7Itad+wexNgZ3QXQTZkmrl3OtlyKAqeUzgtBP/RUdVCSK7krQPrkhs 3wntX5tEYRsBSflzilw9F7bz9G5t3yt+J9Zqi/zq2lttUxbHhyNLt7NZix0FV7Dyk1 FyhFkGaQwHPgQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E374369D8A; Thu, 26 Feb 2026 13:03:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:33 -0700 Message-ID: <20260226200106.1727176-28-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NZTHQOIG4PPXL2R7JUSN4IRJWFUCM6FS X-Message-ID-Hash: NZTHQOIG4PPXL2R7JUSN4IRJWFUCM6FS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 27/32] patman: Update series description when adding a new version List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When adding a new version to an existing series, the description (cover letter subject) is not updated, so it gets stale if the title changes between versions. Update it each time a new version is added. Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 4 ++-- tools/patman/cseries.py | 8 +++++--- tools/patman/database.py | 27 ++++++++++++++++++++------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index a60e02878a5..dd654738c06 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -1369,10 +1369,10 @@ class CseriesHelper: updated += 1 if cover: info = SerVer(svid, None, None, None, cover.id, - cover.num_comments, cover.name, None) + cover.num_comments, cover.name, None, None) else: info = SerVer(svid, None, None, None, None, None, patches[0].name, - None) + None, None) self.db.ser_ver_set_info(info) return updated, 1 if cover else 0 diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 47da57acc0f..0f1766f5539 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -84,11 +84,13 @@ class Cseries(cser_helper.CseriesHelper): series_id = self.db.series_add(ser.name, desc, ups=ups) added = True msg += f" series '{ser.name}'" - elif ups: - self.db.series_set_upstream(series_id, ups) + else: + if ups: + self.db.series_set_upstream(series_id, ups) + self.db.series_set_desc(series_id, desc) if version not in self._get_version_list(series_id): - svid = self.db.ser_ver_add(series_id, version, link) + svid = self.db.ser_ver_add(series_id, version, link, desc) msg += f" v{version}" if not added: msg += f" to existing series '{ser.name}'" diff --git a/tools/patman/database.py b/tools/patman/database.py index a5952c6d2b6..e1ec0dc00e2 100644 --- a/tools/patman/database.py +++ b/tools/patman/database.py @@ -25,7 +25,7 @@ LATEST = 5 SerVer = namedtuple( 'SER_VER', 'idnum,series_id,version,link,cover_id,cover_num_comments,name,' - 'archive_tag') + 'archive_tag,desc') # Record from the pcommit table: # idnum (int): record ID @@ -493,6 +493,17 @@ class Database: # pylint:disable=R0904 self.execute( 'UPDATE series SET name = ? WHERE id = ?', (name, series_idnum)) + def series_set_desc(self, series_idnum, desc): + """Update description for a series + + Args: + series_idnum (int): ID num of the series + desc (str): New description + """ + self.execute( + 'UPDATE series SET desc = ? WHERE id = ?', + (desc, series_idnum)) + def series_set_upstream(self, series_idnum, ups): """Update upstream for a series @@ -617,7 +628,7 @@ class Database: # pylint:disable=R0904 if self.rowcount() != 1: raise ValueError(f'No ser_ver updated (svid {svid})') - def ser_ver_add(self, series_idnum, version, link=None): + def ser_ver_add(self, series_idnum, version, link=None, desc=None): """Add a new ser_ver record Args: @@ -625,13 +636,15 @@ class Database: # pylint:disable=R0904 version version (int): Version number to add link (str): Patchwork link, or None if not known + desc (str or None): Series description for this version Return: int: ID num of the new ser_ver record """ self.execute( - 'INSERT INTO ser_ver (series_id, version, link) VALUES (?, ?, ?)', - (series_idnum, version, link)) + 'INSERT INTO ser_ver (series_id, version, link, desc) ' + 'VALUES (?, ?, ?, ?)', + (series_idnum, version, link, desc)) return self.lastrowid() def ser_ver_get_for_series(self, series_idnum, version=None): @@ -648,8 +661,8 @@ class Database: # pylint:disable=R0904 ValueError: There is no matching idnum/version """ base = ('SELECT id, series_id, version, link, cover_id, ' - 'cover_num_comments, name, archive_tag FROM ser_ver ' - 'WHERE series_id = ?') + 'cover_num_comments, name, archive_tag, desc ' + 'FROM ser_ver WHERE series_id = ?') if version: res = self.execute(base + ' AND version = ?', (series_idnum, version)) @@ -690,7 +703,7 @@ class Database: # pylint:disable=R0904 """ res = self.execute( 'SELECT id, series_id, version, link, cover_id, ' - 'cover_num_comments, name, archive_tag FROM ser_ver') + 'cover_num_comments, name, archive_tag, desc FROM ser_ver') items = res.fetchall() return [SerVer(*x) for x in items] From patchwork Thu Feb 26 20:00:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1965 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136203; bh=pA3cShkcU+qB6k7ax66zWgmbvksKp/Eux7aIvR7jqwQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OdjTXJNlT63DxaJfxg5vwpNFOIFPCOspfHgkOx5S/HMNdnFq4U85osmkHY+Lg2sS5 gzsX6O9p1410ub8FzjC2AdRF+oRoO0rQptlrnqWcTBRNSXH40uRU+snJPvwipGe22W sQHXBV6zr7D47nIZdhroVulr87w5kxJVMgW0IDaQIKjI9Ky9CuIYZOCCy6pfuRBnZ4 Q7fgETMtfhfRiM70id2h34u90fYvhu9jfi2rxIWnaI5x3VoZqBjqkdZtWb0friLbWg blleUAvb9WdFvN435COwnpk6TCYWKYDXbULzkAVLD9y9gx2TAPo47ZJTsk8x3s7D9T WTINpEX0fVsxg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7F91F69E35 for ; Thu, 26 Feb 2026 13:03:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id b59fy0y5Mkeg for ; Thu, 26 Feb 2026 13:03:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136203; bh=pA3cShkcU+qB6k7ax66zWgmbvksKp/Eux7aIvR7jqwQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OdjTXJNlT63DxaJfxg5vwpNFOIFPCOspfHgkOx5S/HMNdnFq4U85osmkHY+Lg2sS5 gzsX6O9p1410ub8FzjC2AdRF+oRoO0rQptlrnqWcTBRNSXH40uRU+snJPvwipGe22W sQHXBV6zr7D47nIZdhroVulr87w5kxJVMgW0IDaQIKjI9Ky9CuIYZOCCy6pfuRBnZ4 Q7fgETMtfhfRiM70id2h34u90fYvhu9jfi2rxIWnaI5x3VoZqBjqkdZtWb0friLbWg blleUAvb9WdFvN435COwnpk6TCYWKYDXbULzkAVLD9y9gx2TAPo47ZJTsk8x3s7D9T WTINpEX0fVsxg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6EB1769E39 for ; Thu, 26 Feb 2026 13:03:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136202; bh=XOXDRKgYaEqDlLkVwYunx4Fjqigd8jqbkqAlwMqjvb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a80tc7ouzi9kWk/gmfByOjiv8i0Hkji+kg2eDM19bpg9u5MW8+f2n7RNHoAZqZ6iB LgNF+PoFf1j5Ejsl5Hvs2Obhu5+QGwATuMwDECMouEEYcx/I9ZLdaK3M7Con0AR+kX iDvKGoikPV59HfgC2e8oHBJXoHAur2I+NPJpQym1V8ehB6dXOSB18q8sr0d20sLd2w k51ZQy+aCQ2dm1PZkCZocbaHRWf1JwUlDm5CvN8IJvBKk67y5XO0b7Pd/ya+f2tPXp NgDAoDnom5uS+Ny/pykxBCNX5mEH5zep0i9DdraoKPVzKUoeDnMzf7g9heIelrag3l oLiDTx6VzlzPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7B11969E35; Thu, 26 Feb 2026 13:03:22 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id GpXtPho7i4s7; Thu, 26 Feb 2026 13:03:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136198; bh=Gsxix4P0YZoWv62OpPlYrMIMQ8Dfs0vSEXN2pMQXpZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uMdN6pEni8cMM3kO63/mR8ULxGKnC1+6vS5olIF1A+loGzDUyOq1vk+L9exev0rCl lwwE0XZYDq9aCUd9ZnMYSvQggyRUmr3uJBBaJDuMLYSi4jYnJ6dGWrj9g6rTpf1wkY WAXEr6sc5rkz2QheenfpaF1hs43b67PKKkS4QwIvs9uL8lFwgP73SY2IX6v25JDpaB sdXvPOl94GQ4jtjM+4juTfu3cLYpDB6qQ93mUI0VSgwCpwo6Pe26NunvTu3ROwV3wY tj9nn/HNaJ2vXqDUnwC5/hieYZ30FqGRRfAowNE+cpQcUN9siXvlCHU2qBZcRlhkKR AFHJU/1l9Cklg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2277D69D4A; Thu, 26 Feb 2026 13:03:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:34 -0700 Message-ID: <20260226200106.1727176-29-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DNWCVNQRP7JY7BOXLPEQQNVWZSGVIFV7 X-Message-ID-Hash: DNWCVNQRP7JY7BOXLPEQQNVWZSGVIFV7 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 28/32] patman: Improve send feedback and upstream list formatting List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the sendemail identity message from upstream lookup to the send path, so it appears closer to the actual send. Change the Series-to mismatch from a warning to an error, since sending to the wrong list is likely unintentional. Widen the URL column in upstream list to avoid truncation. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 8 +++----- tools/patman/send.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 0f1766f5539..81a8712b3de 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -941,8 +941,6 @@ class Cseries(cser_helper.CseriesHelper): identity, series_to, no_maintainers, no_tags = settings if identity and not getattr(args, 'identity', None): args.identity = identity - print(f"Using sendemail identity '{identity}'" - f" from upstream '{ups}'") if series_to: args.series_to = series_to if no_maintainers: @@ -1220,8 +1218,8 @@ class Cseries(cser_helper.CseriesHelper): """ udict = self.get_upstream_dict() - print(f"{'Name':6} {'Def':3} {'Project':10} {'URL':40} Options") - border = (f"{'-' * 6} {'-' * 3} {'-' * 10} {'-' * 40} " + print(f"{'Name':6} {'Def':3} {'Project':10} {'URL':44} Options") + border = (f"{'-' * 6} {'-' * 3} {'-' * 10} {'-' * 44} " f"{'-' * 20}") print(border) for name, items in udict.items(): @@ -1241,7 +1239,7 @@ class Cseries(cser_helper.CseriesHelper): opts.append('no-maintainers') if no_tags: opts.append('no-tags') - print(f'{name:6} {default:3} {proj_name:10} {url:40} ' + print(f'{name:6} {default:3} {proj_name:10} {url:44} ' f'{" ".join(opts)}') def upstream_set(self, name, **kwargs): diff --git a/tools/patman/send.py b/tools/patman/send.py index 51d2c533540..eb9a8e0da2e 100644 --- a/tools/patman/send.py +++ b/tools/patman/send.py @@ -190,8 +190,9 @@ def send(args, git_dir=None, cwd=None): if series_to: to_list = series.get('to', []) if to_list and series_to not in to_list: - print(f"WARNING: Series-to tag {to_list} does not include " - f"expected '{series_to}' from upstream settings") + raise ValueError( + f"Series-to tag {to_list} does not match " + f"expected '{series_to}' from upstream settings") if not to_list: series['to'] = [series_to] @@ -200,12 +201,16 @@ def send(args, git_dir=None, cwd=None): ok = ok and gitutil.check_suppress_cc_config() + identity = getattr(args, 'identity', None) + if identity: + print(f"Using sendemail identity '{identity}'") + its_a_go = ok or args.ignore_errors cmd = email_patches( col, series, cover_fname, patch_files, args.process_tags, its_a_go, args.ignore_bad_tags, args.add_maintainers, args.get_maintainer_script, args.limit, args.dry_run, args.in_reply_to, args.thread, args.smtp_server, - identity=getattr(args, 'identity', None), cwd=cwd) + identity=identity, cwd=cwd) return cmd and its_a_go and not args.dry_run From patchwork Thu Feb 26 20:00:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1966 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136209; bh=VEsdfnqPk/tp+CiP3247SP//uYLh9E6uCnZEvbi3gX4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ewWgdkthyW69o5bEc3ElkuzTJKbViFvfTvircGXkDQwBUV/5jpV3WJ3m3tHX+WeKM AkPKQTg3I6gh1GzQ30wczM/2cVUh1BCvLGcEU2k9LNv3KCpQ/8LPBru+8yYSFkTkVL u35i1mDfwesEpTYuYipY7iR6h35uk4v/doGtViPMkLXUfHNOpw522D8orxp4dYiwTW D2pG7U3VYMZa81Ii+It+E1tRFTKoDyGu7SyWYxaaGCO4aXNkECKh2w4rxASirJe3gm WhaITj9znrJzV6p0b8YPNpF24Q2pBpzTb1tqAiWNKVCP/nPG2KG3eaNKAsuAadoaOl Zub8yoqRoVgog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 08FEA69E42 for ; Thu, 26 Feb 2026 13:03:29 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mv0XmaOswvUV for ; Thu, 26 Feb 2026 13:03:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136208; bh=VEsdfnqPk/tp+CiP3247SP//uYLh9E6uCnZEvbi3gX4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tBqV6d281xyaNrpwslvs3irXmDb1PLcG2Csq0VNrLqZwPVcCrAJjukjjxsXcVs5t2 deqhnvoS+7zv80QP00RZww34StTafiT+kQ95Nco2xO5mLn/tF25S4u2H38GadjZRxQ TBlf9OpRwPnBFm5NH/0t29Z14dPjyznYGKXme6OCqDVpVX72R18wFUoWKu43vXsewj QO7b75GhNICPmeBpj4h1uj3LDbp6zG5urXo/sg7LQ9vWuTxiNS+yhSKoMef6PKyLYR 72okPJQjDwQmbyFYTsq+qS96JN2FE0vHBB1Ir2mSYl+4V7vMFP118+htGAzlFllRPn XRBqImRqX1apw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E9C9F69E35 for ; Thu, 26 Feb 2026 13:03:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136207; bh=qYowomTjymAN/18PC6b/xbnemNjKJzI7Lm3ZeU5RtQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sEitmiLx3J/OxicZj7eXWK7xwwzDqiv9AxoMoIx3fdvJZ5fgCwwANWIOY8i2kg/A5 e+ka0MFCE6QrAvnJywuh4DiyuHqybQzLfhDae0yzHNpfLfeF1YxBTJ/R7SjYtNWmrI i/2HGtT+SkhbUMK5gFFr0X54V99bBiETbc1hTvQ0HoBwn5ChJTx9MFsqhPrloigVQV rnBS6UHmNAmQjUnFaq2/MQVodJ8JeRQFBqKHRJiwrIcqRp+wp/nkWfbw5l6krUObEC KTp4qpXKt69ftYfu54/3wQNY0GCThLEfsZRDb9c+W+Hc29KUZ0z/rGAXDYZ8ImhvF6 Xf9ydOYOgF3hA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CB5D69D8A; Thu, 26 Feb 2026 13:03:27 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id bvAtTE1Qzxwr; Thu, 26 Feb 2026 13:03:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136203; bh=hgRZ0LCS3MNFlLMipz1bN1NSFxG/nvAWA5Ed6UneA8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UehYtf3i4TrscOF8IQL+cF0pXZNIdIiu02TtAAzC1U4r1NTlzvC/PEQ0okOyLJadc Yo60oX13nSt7akNhYsCXVgSl3FFeaEwJyfDNiGpBknlfRoggnnpkfGlB7KtXaLEy+a QMdhjqPsy+tFdbCsqKbTmdgG8SV82NmSERn8HZSlNlxAgLVjnRkQ7693KD7OWFsi+3 6zSOsMr/3X4qtQcdDX01cpEK3DA74ai/O3bAVowmlVx+rK/3nrPcPPdx1uGHZrQ9ub Fm3YPAYk27CP1w2h9A2dOkOxZKcfowmbLGOH+ippnhEeZX9latSaqftETCMTBc1JK3 koc5qM2JvMrYg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BFCBD69D4A; Thu, 26 Feb 2026 13:03:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:35 -0700 Message-ID: <20260226200106.1727176-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z47W353CFFAOMZKYJAEHCFWUY6ABJP7F X-Message-ID-Hash: Z47W353CFFAOMZKYJAEHCFWUY6ABJP7F X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 29/32] patman: Improve autolink wait with progress and backoff List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Use tout.progress() to show an updating status line while waiting for a series to appear on patchwork, instead of printing the full match table every iteration. Only show matches when they change. Back off the sleep interval from 5s up to 30s to reduce server load. On failure, print the patman autolink command to use later. Remove the noisy "Sleeping for N seconds" message from sleep(). Signed-off-by: Simon Glass --- tools/patman/cser_helper.py | 1 - tools/patman/cseries.py | 43 +++++++++++++++++++++++++++++++----- tools/patman/test_common.py | 1 + tools/patman/test_cseries.py | 28 +++++++++++++++-------- 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py index dd654738c06..ec3956db4d5 100644 --- a/tools/patman/cser_helper.py +++ b/tools/patman/cser_helper.py @@ -205,7 +205,6 @@ class CseriesHelper: Args: time_s (float): Amount of seconds to sleep for """ - print(f'Sleeping for {time_s} seconds') if self._fake_time is not None: self._fake_sleep(time_s) else: diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 81a8712b3de..0b4ce91b024 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -284,27 +284,58 @@ class Cseries(cser_helper.CseriesHelper): start = self.get_time() stop = start + wait_s sleep_time = 5 + last_options = None while True: pws, options, name, version, desc = self.link_search( pwork, series, version) if pws: + tout.clear_progress() if wait_s: tout.notice('Link completed after ' f'{self.get_time() - start} seconds') break - print(f"Possible matches for '{name}' v{version} desc '{desc}':") - print(' Link Version Description') - for opt in options: - print(f"{opt['id']:6} {opt['version']:7} {opt['name']}") if not wait_s or self.get_time() > stop: + tout.clear_progress() + if options != last_options: + self._show_autolink_matches(name, version, desc, + options) delay = f' after {wait_s} seconds' if wait_s else '' - raise ValueError(f"Cannot find series '{desc}{delay}'") - + raise ValueError( + f"Cannot find series '{desc}'{delay}; " + 'to try again later:\n' + f" patman series autolink -s {name} -V {version}") + + if options != last_options: + tout.clear_progress() + self._show_autolink_matches(name, version, desc, options) + last_options = options + + elapsed = int(self.get_time() - start) + tout.progress( + f'Waiting for series on patchwork ({elapsed}s)') self.sleep(sleep_time) + sleep_time = min(sleep_time + 5, 30) self.link_set(name, version, pws, update_commit) + def _show_autolink_matches(self, name, version, desc, options): + """Show possible autolink matches + + Args: + name (str): Series name + version (int): Series version + desc (str): Series description + options (list of dict): Possible matches from patchwork + """ + print(f"Possible matches for '{name}' v{version} desc '{desc}':") + if options: + print(' Link Version Description') + for opt in options: + print(f"{opt['id']:6} {opt['version']:7} {opt['name']}") + else: + print(' (none)') + def link_auto_all(self, pwork, update_commit, link_all_versions, replace_existing, dry_run, show_summary=True): """Automatically find a series link by looking in patchwork diff --git a/tools/patman/test_common.py b/tools/patman/test_common.py index 7da995dda22..6cf007cc1f2 100644 --- a/tools/patman/test_common.py +++ b/tools/patman/test_common.py @@ -66,6 +66,7 @@ class TestCommon: self.gitdir = os.path.join(self.tmpdir, '.git') tout.init(tout.DEBUG if self.verbosity else tout.INFO, allow_colour=False) + tout.stdout_is_tty = False def tearDown(self): """Delete the temporary dir""" diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 3d475956ff9..c0beb128265 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -3750,15 +3750,25 @@ Date: .* with terminal.capture() as (out, _): cser.link_auto(pwork, 'second3', 3, True, 50) itr = iter(out.getvalue().splitlines()) - for i in range(7): - self.assertEqual( - "Possible matches for 'second' v3 desc 'Series for my board':", - next(itr), f'failed at i={i}') - self.assertEqual(' Link Version Description', next(itr)) - self.assertEqual(' 456 1 Series for my board', next(itr)) - self.assertEqual(' 457 2 Series for my board', next(itr)) - self.assertEqual('Sleeping for 5 seconds', next(itr)) - self.assertEqual('Link completed after 35 seconds', next(itr)) + + # Matches shown only once (they don't change between retries) + self.assertEqual( + "Possible matches for 'second' v3 desc 'Series for my board':", + next(itr)) + self.assertEqual(' Link Version Description', next(itr)) + self.assertEqual(' 456 1 Series for my board', next(itr)) + self.assertEqual(' 457 2 Series for my board', next(itr)) + + # Progress messages with backoff (5, 10, 15, 20s sleeps) + self.assertEqual( + 'Waiting for series on patchwork (0s)...', next(itr)) + self.assertEqual( + 'Waiting for series on patchwork (5s)...', next(itr)) + self.assertEqual( + 'Waiting for series on patchwork (15s)...', next(itr)) + self.assertEqual( + 'Waiting for series on patchwork (30s)...', next(itr)) + self.assertEqual('Link completed after 50 seconds', next(itr)) self.assertRegex( next(itr), 'Checking out upstream commit refs/heads/base: .*') self.assertEqual( From patchwork Thu Feb 26 20:00:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1967 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136212; bh=CBKXZ3NcdefK61BZwywiKWSjoi45i8SSNXwwrUaRdEI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lMv9xNvHq0ogST8J5oMbhRXBlTCSMkMuHm55Z1WBecBDc/pPrG4cVC6dcQFoZe7aW 2350HHDv3aGQnsqLBLH1u+vDgRCBot06/Ozr27tdj+aQLRuhF0ACVv3X4cam5huexU d2H+cJZic8nMM760uCTllE/eQ0NoKFJk3ZQrM8kNeyYbvgU3rzWILWiGlXZbN/5SJN dSv9BX8zkdBPoTjCaeEPI8biuzSbK7MiDGrSwVtw64JQxisO832QPfAsMpnUHqlgwo QLtFBTDYTJCijWxx9P+4g2uLEpNMSSvKkKtgmdLiz6eAG+PPWAdGZmVjiMVvhfgx5R 1MpEu8bX6FY8Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7011069E42 for ; Thu, 26 Feb 2026 13:03:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5Uxn4JCd8yQG for ; Thu, 26 Feb 2026 13:03:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136212; bh=CBKXZ3NcdefK61BZwywiKWSjoi45i8SSNXwwrUaRdEI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lMv9xNvHq0ogST8J5oMbhRXBlTCSMkMuHm55Z1WBecBDc/pPrG4cVC6dcQFoZe7aW 2350HHDv3aGQnsqLBLH1u+vDgRCBot06/Ozr27tdj+aQLRuhF0ACVv3X4cam5huexU d2H+cJZic8nMM760uCTllE/eQ0NoKFJk3ZQrM8kNeyYbvgU3rzWILWiGlXZbN/5SJN dSv9BX8zkdBPoTjCaeEPI8biuzSbK7MiDGrSwVtw64JQxisO832QPfAsMpnUHqlgwo QLtFBTDYTJCijWxx9P+4g2uLEpNMSSvKkKtgmdLiz6eAG+PPWAdGZmVjiMVvhfgx5R 1MpEu8bX6FY8Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5DDEE69D4A for ; Thu, 26 Feb 2026 13:03:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136211; bh=9lYTeka7xzN2ENBYY1yuu8UKR03Ey6YJGQkNFFoduOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDvszUPVZ9vBOamrIpps05uN1vnGsV9UuzKy5nB8xXLIgEl/KJuwEK6QPZTe/jOHo IUAX5LjFtDinJFs61iZWB2TzGyRFUGi4/AZAF5L9Zk6sw8Ge2QrJ9LDZ2IPXsEUEeG eBO9A3dekeFada7MQO9VnEh0jTo48GT4X/loRui+T6ErHkModu9LRzZwe9xm4qo/+M OOZqI7P7Kwz9EvoZjBxpfqdTJw3wLOa5jmDyDuMSoDzQAfr1I7s6kvqIouqVXNQhJ6 AjnMI8eILKjtd+ZTX7V3uvi8qfkPtKK0J9ihpCsC/TLpNMG+aVDeMYB7ftx42Xursp g+TDiXJtqTrmw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 840E569D8A; Thu, 26 Feb 2026 13:03:31 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id olp9-WwN40X4; Thu, 26 Feb 2026 13:03:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136207; bh=iOm+Yg1jMPUX95gIUNzbfo1VLr9zVG6AGI7yTyLG2u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=chh7XMLLa1wJC1abDiaZ4IS0j9updjpQWHoDz/dB0DA5UpzjE784Gn++Hd47MEJMb RfDZuY5WQ2c5KhTJMaEXqYZRD42R+ql6QG74feRj4AaaCjc2GJ8B8U2eRI1efTFJLF G4YVAwmlaW5O8Pt9rPE3dMqnFD6w2Xg2MGeNxpTE8aarvOIx+PYYxDoBZF1eTU+Bd3 hb77DUzj7qlWfy8aKTAlOz7y5YpXwuMMmWOxVSkk6W9RQDF71bwjXghafYDEOZzNCw qieEzjBk5VtLeG+mesIpZ1giZh5lC1gFU3iZrOFysTDX/GbWSLj0fCJzw9988Jl5fg YhysUuWJdFRSw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 71BA769D4A; Thu, 26 Feb 2026 13:03:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:36 -0700 Message-ID: <20260226200106.1727176-31-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SBYCFNGQS62EX3NFH43QESLEQYVNFT4B X-Message-ID-Hash: SBYCFNGQS62EX3NFH43QESLEQYVNFT4B X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 30/32] patman: Filter out AI co-developer tags from patches List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Strip Co-developed-by and Co-Authored-By tags that use noreply@ email addresses, since these indicate AI-generated contributions rather than human co-developers. Human co-developer tags are preserved. Signed-off-by: Simon Glass --- tools/patman/patchstream.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 429bbfb3bac..27cd1980e38 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -23,6 +23,10 @@ from u_boot_pylib import gitutil RE_REMOVE = re.compile(r'^BUG=|^TEST=|^BRANCH=|^Review URL:' r'|Reviewed-on:|Commit-\w*:') +# AI co-developer tags to remove (noreply@ indicates non-human) +RE_AI_TAG = re.compile(r'^(Co-developed-by|Co-Authored-By):.*noreply@', + re.IGNORECASE) + # Lines which are allowed after a TEST= line RE_ALLOWED_AFTER_TEST = re.compile('^Signed-off-by:') @@ -445,7 +449,8 @@ class PatchStream: self.commit.subject = line # Detect the tags we want to remove, and skip blank lines - elif RE_REMOVE.match(line) and not commit_tag_match: + elif (RE_REMOVE.match(line) or RE_AI_TAG.match(line) + ) and not commit_tag_match: self.skip_blank = True # TEST= should be the last thing in the commit, so remove From patchwork Thu Feb 26 20:00:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1968 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136214; bh=AJTEwrnNS5enwn0Z5IQj4A5T7RidEwK+smdERoOtqyk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Gi3hfewvmg1zBWnHLD/2tsdD6DqdKNop4ioKJEG8VJ+OEy6Ll4pa0lQ1FzUpl2LZj aexJ9dlBDK01JpDVpsuwuvAsHMBZgHXbr5E70Zts58HMsU6/CccqFpbqal+pYavQvb Id4NVEfC0yW5+1Quk37xiPzUEojBk/Bu1RU4UcyQm0jcHUwC+1V7OYOHH5wfehNo04 anvcBMSZPNYmPBECVukNfEmJFBbFncxd2r2FpY0eb69NE0Cc1IToY3SV9S9LpUsGpR e6+r/+nD5frjYZY6a7Z81RVlp2xpkfAHATPNSJCmLSRNJ8W1tYGDnrwU+k6dkn1i6m gfu7GjVCOPrZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2E39669E42 for ; Thu, 26 Feb 2026 13:03:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id P3aWZxZz3QTx for ; Thu, 26 Feb 2026 13:03:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136214; bh=AJTEwrnNS5enwn0Z5IQj4A5T7RidEwK+smdERoOtqyk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Gi3hfewvmg1zBWnHLD/2tsdD6DqdKNop4ioKJEG8VJ+OEy6Ll4pa0lQ1FzUpl2LZj aexJ9dlBDK01JpDVpsuwuvAsHMBZgHXbr5E70Zts58HMsU6/CccqFpbqal+pYavQvb Id4NVEfC0yW5+1Quk37xiPzUEojBk/Bu1RU4UcyQm0jcHUwC+1V7OYOHH5wfehNo04 anvcBMSZPNYmPBECVukNfEmJFBbFncxd2r2FpY0eb69NE0Cc1IToY3SV9S9LpUsGpR e6+r/+nD5frjYZY6a7Z81RVlp2xpkfAHATPNSJCmLSRNJ8W1tYGDnrwU+k6dkn1i6m gfu7GjVCOPrZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 13BD069D8A for ; Thu, 26 Feb 2026 13:03:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136212; bh=Iizt8CaXCRFvXVGyAibo5NDriPc5ONmMGC2FYn28hxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=muKwtmN9QtsAFmUKhiDmS/yC/xfdJbePcMM+KISiRoEgXXlPy+QgAsj/1Erp1AYvk XRpN5sNB8IURgr7RGbnUqvcixibjTh744n7vwhUXcTJi8A3iV6encE43FAQjvSgzAG IxTdkW/nkezEKu3xdItjWhcYCep3llONecudj4VRgSTv+8nCGTE/S4PiI/VjLKWqC2 hS1DQMx1PH7JOgMOr7FIScbqIchzp8Gu1dSdHY89jCwuMMirpyuh3SZSGLXKjxcieJ vX/+7s5NNsrOQpLnCmV4tV0imaAEoYLubcooFprbjzdqvF3FLAveMiqLMIxb1pj8T/ XXWQ45Ipf+0sg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4FE1369D8A; Thu, 26 Feb 2026 13:03:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id vkH5YJJSJw87; Thu, 26 Feb 2026 13:03:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136212; bh=Wj22r2zs1qMIzuVk93e4IUrvqwBZ5aLfi2g9auSUsKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RI00PlwAngybvKsU/H0stKgJ2fwR+Xs4d+mFLAO4mSNmqOrKhDAFgqulgiMrLG78w AlsvmMPLej/dEBvkspdHDwAC080/L2Tu8keZxnX1uDtu1qJzF7+iaimYTfIgRtfDw4 H+oNDlf2OlhjhE6ntlyTLy6vP2nc2gMAOVFDWP0vJhTRB6YQzuEXFnkdvbLIaXvseN rD9nWYficWzPwp6VMD6d6blK+dd6y6IQeNljp81dNGKZ3S2ISYcQMvJXSMcnfvtkAi xvQfXFe9+jJp6u6vGkjSgoG4v3knO6AEGCSkKtI1FRLSUgqW49L6ai4Ey+SqC4lNV7 XUybPjuiQGQuQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CB83F69D4A; Thu, 26 Feb 2026 13:03:31 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:37 -0700 Message-ID: <20260226200106.1727176-32-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UPMTJ67HIOLI2U66NACKGO2EIHVCEWNJ X-Message-ID-Hash: UPMTJ67HIOLI2U66NACKGO2EIHVCEWNJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 31/32] patman: Update series description on scan List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass 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 Signed-off-by: Simon Glass --- tools/patman/cseries.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) From patchwork Thu Feb 26 20:00:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1969 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136218; bh=yZYFFxvqdPWwQnjIdHIT9a/R2l9Nv5b+V6V3fWukS8w=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZAPqN4XXb6PzWPztgG5UrPnxDhrTTcyTrG8wzIsuxEYPbYClHGKfdP6cqscOQar24 rucWA0dbeS7gNONAirvcj1nRXdRBQSaSuUf2+h2ig+krcVLZ6jz9+KMKNFRq57n7TO QNka6Wa+rT0M2AmGcchSpcd2V0ReFHKftn6VEG1Wmisl4pNh3sEEST2tQ/c9P2Y2aJ MJSgfGxXLSO1utHMwwolxyK9IHiA+B/3NIO+1b7XB8UlqYf1h3cIIPMTO560MCf4OD 7ucpYFxn2AFZqmORyRlMQwqoGq4MrTMtmYknfIkYG6y5eJTJzHB44EZTjUCC1lMvw3 sDsCWzRwjofig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 882C269E39 for ; Thu, 26 Feb 2026 13:03:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id yp9elZAyDPpH for ; Thu, 26 Feb 2026 13:03:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136218; bh=yZYFFxvqdPWwQnjIdHIT9a/R2l9Nv5b+V6V3fWukS8w=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZAPqN4XXb6PzWPztgG5UrPnxDhrTTcyTrG8wzIsuxEYPbYClHGKfdP6cqscOQar24 rucWA0dbeS7gNONAirvcj1nRXdRBQSaSuUf2+h2ig+krcVLZ6jz9+KMKNFRq57n7TO QNka6Wa+rT0M2AmGcchSpcd2V0ReFHKftn6VEG1Wmisl4pNh3sEEST2tQ/c9P2Y2aJ MJSgfGxXLSO1utHMwwolxyK9IHiA+B/3NIO+1b7XB8UlqYf1h3cIIPMTO560MCf4OD 7ucpYFxn2AFZqmORyRlMQwqoGq4MrTMtmYknfIkYG6y5eJTJzHB44EZTjUCC1lMvw3 sDsCWzRwjofig== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 76F5369D8A for ; Thu, 26 Feb 2026 13:03:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136217; bh=lTa1u+UOouwSf2J7hwSXK6sHmwkIVd8d0MS16YaC0Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQ0UPlvR42vBX4nuLLWVXf/XPjOmQXYCkjPecxh3Z5hUFaNmWauy7dVZikMyrniA9 YMK+R49hPB8alDi3mE5OSr/AgyD9jBKh732n1VXXBXIGOEnZ8CprwGZPIOZC89eRQd WV5qm61sXRXVWX/4v7xF5LtR9EaCf/FjNljhyjfTgUC9dYzKEf+XecEeT2TPXXG8ml d0LyJGY7K7pqGhtquGCQ7z6Rim6sQkZP75QViS8W1lOmm79SAhbcOKU5qv9zEmHgGM o7puQWsg4hgskuUU3vmT40zU0WyThoV0tZ0EtOxlZLNlf9XhwIiqA2w2Ol/im5Watw w2shXy4CB1p5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 183CE69D4A; Thu, 26 Feb 2026 13:03:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id gjZ5VRBhwd5x; Thu, 26 Feb 2026 13:03:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1772136212; bh=Tb8e2pn6GlKgwjPTr/QMIy95urp/DlGpjx3BCzUrgGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Luxj5vZzPRCli+ZNMwiVxEaIO1L1iDKvjrtaGjo0C0xWsBEg64izwvB9uS0uZXfBC 3yqKt3IvweiOb5cnicqQDEugrKOGoVOPLZtqhah19MAiTY5XYP9JppwISVQWG0Hi/h ZV4N+DWIbSeGDiFfMLzC79S011tAHUO7zK8bbjZH1oUQI3gmdzKsirbFVE7iKi9ADp m5MQ8esF+FOCPjDz7I/ABRmkKdw7TKrGtCkKWbXRRLYpKWw6uz7n8u8otOCW/J2nCq sgoXXI7b42m8Vv7KExOD526nfV+XL5QgFVuzAdz/IL1EB3NgxgCRCe2DiGjTCqfaVt nI/xIH/eCt3wg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 958DB69E35; Thu, 26 Feb 2026 13:03:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 26 Feb 2026 13:00:38 -0700 Message-ID: <20260226200106.1727176-33-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260226200106.1727176-1-sjg@u-boot.org> References: <20260226200106.1727176-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VIUV2HDVBEPES6Y2GCGNKEG6CDGYWLGW X-Message-ID-Hash: VIUV2HDVBEPES6Y2GCGNKEG6CDGYWLGW X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 32/32] patman: Document multi-upstream setup List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a step-by-step guide covering how to configure multiple upstreams with different patchwork servers, sendemail identities, To addresses and send options. Signed-off-by: Simon Glass --- tools/patman/patman.rst | 167 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst index 549e203c254..87e0984c0d7 100644 --- a/tools/patman/patman.rst +++ b/tools/patman/patman.rst @@ -936,6 +936,173 @@ Here is a sample 'progress' view: :width: 800 :alt: Patman showing the progress view +Multiple upstreams +~~~~~~~~~~~~~~~~~~ + +If you send patches to more than one upstream tree (e.g. U-Boot mainline and +the U-Boot concept tree), you can configure patman with multiple upstreams so +that each series automatically uses the correct send settings for its +destination. The trees may use different mailing lists, patchwork servers and +SMTP credentials. + +The key concepts are: + +**Upstream** + A remote git repository that you send patches to. Each upstream has a name + (e.g. ``us``, ``ci``) and a URL. Upstreams can also carry send settings: + a patchwork URL, a sendemail identity, a To address and flags controlling + ``get_maintainer.pl`` and subject-tag processing. Use ``patman upstream`` + commands to manage these. + +**Patchwork project** + The patchwork server tracks patches for a project (e.g. ``U-Boot``). + Each upstream can point to a different patchwork server, and patman needs + to know the project name on that server so it can look up series links. + Use ``patman patchwork set-project`` to configure this per upstream. + +**Sendemail identity** + Git supports multiple SMTP configurations via ``[sendemail ""]`` + sections in ``.gitconfig``. An upstream can reference one of these + identities so that patman passes ``--identity`` to ``git send-email`` + automatically. + +**Series upstream** + Each series can be associated with an upstream. When you send the series, + patman looks up the upstream's settings and applies them. This means the + correct identity, To address and patchwork server are used without any + extra flags on the command line. + +Here is a step-by-step guide for a developer who sends to both U-Boot +mainline and the U-Boot concept tree. + +Step 1: Add your upstreams +.......................... + +First, add each upstream with its git remote URL, patchwork URL and send +settings:: + + patman upstream add us https://source.denx.de/u-boot/u-boot.git \ + -p https://patchwork.ozlabs.org -t u-boot + + patman upstream add ci https://concept.u-boot.org/u-boot/u-boot.git \ + -p https://patchwork.u-boot.org -t concept -I concept -m --no-tags + +The options are: + +``-p`` / ``--patchwork-url`` + URL of the patchwork server for this upstream + +``-t`` / ``--series-to`` + Patman alias for the To address (from your ``~/.patman`` alias file) + +``-I`` / ``--identity`` + Git sendemail identity (selects ``[sendemail ""]`` from + ``.gitconfig``) + +``-m`` / ``--no-maintainers`` + Skip running ``get_maintainer.pl`` + +``--no-tags`` + Skip subject-tag alias processing + +You can check your upstreams with:: + + patman upstream ls + +You can also set a default upstream:: + + patman upstream default us + +Step 2: Configure git sendemail identities +.......................................... + +If your upstreams use different SMTP servers or credentials, set up git +sendemail identities in your ``.gitconfig``. Each identity is a +``[sendemail ""]`` section that overrides the base ``[sendemail]`` +settings. + +For example, to use one SMTP server by default and a different one for the +concept tree (server names and credentials are just examples; substitute your +own):: + + [sendemail] + smtpserver = smtp.denx.de + smtpserverport = 587 + smtpencryption = tls + + [sendemail "concept"] + smtpserver = smtp.gmail.com + smtpserverport = 587 + smtpencryption = tls + smtpuser = user@gmail.com + +The base ``[sendemail]`` settings are used when no identity is specified. When +you add ``-I concept`` to an upstream, patman passes ``--identity=concept`` to +``git send-email``, which selects the matching section. + +Step 3: Set up patchwork projects +................................. + +Each upstream needs a patchwork project so that patman can find your series on +the server:: + + patman patchwork set-project U-Boot us + patman patchwork set-project U-Boot ci + +This looks up the project on the patchwork server associated with the upstream +and stores the project ID locally. + +Step 4: Set up aliases +...................... + +Add To-address aliases to your ``~/.patman`` file:: + + [alias] + u-boot: U-Boot Mailing List + concept: U-Boot Concept + +These are the names referenced by ``--series-to`` above. + +Step 5: Add series with an upstream +.................................... + +When adding a series, specify which upstream it targets:: + + patman series add -S us + +If you omit ``-S``, you can set it later with:: + + patman series set-upstream + +Step 6: Send +............ + +When you send a series, patman automatically applies the upstream's settings:: + + patman series send + +This looks up the upstream for the series and: + +- passes ``--identity`` to ``git send-email`` if configured +- sets the To address from ``--series-to`` if no ``Series-to:`` tag is present +- skips ``get_maintainer.pl`` if ``--no-maintainers`` is set +- skips tag processing if ``--no-tags`` is set + +If the series has a ``Series-to:`` tag that does not match the upstream's +expected To address, patman raises an error. This prevents accidentally sending +to the wrong mailing list. + +Updating upstream settings +.......................... + +To change settings on an existing upstream, use ``upstream set``:: + + patman upstream set ci -I chromium + patman upstream set us -p https://patchwork.ozlabs.org + +The same flags as ``upstream add`` are available, plus ``--maintainers`` and +``--tags`` to re-enable options that were previously disabled. + General points --------------