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"""