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):