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