From patchwork Sat Apr 4 21:28:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2137 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=1775338352; bh=bPK/i5DHDRrkoSpCQLMi+1yaEfv8+EVjDvYbEHtnit4=; 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=lrvheMBBE/V6wciJVZ3QDiFX5zurockrxvjfpsIDFVVrcB7Ma9r4eMZC6z4+oPyGG haKAiweaMqKWOBM/O6j6Gf7HhMMaa9sVP3k4w7Cewi1yQCPWk6r0+ALy1QUXy3GwgX 9CtiwkKOzUYHDjx3tnATWTkffrHENocenZMsUKLAnOwXXajdY6cHnyPMyI8XgwUcUh 0MO3GShhXvLCK19Es2JOh2FGPBP2aHy+jenkIXCUwyk+9rC8WEMkM5AzpoqH9f19vV 3lgYqKIYpVQkNTfmaxwYn5cdQlSBRlCwZJdf51WrfzZQBbYx8PJrtfjIWLjqBzNaNX HTU4Pk35rD0yg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 741725FC8F for ; Sat, 4 Apr 2026 15:32:32 -0600 (MDT) 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 9CsP5vHcbMBv for ; Sat, 4 Apr 2026 15:32:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775338352; bh=bPK/i5DHDRrkoSpCQLMi+1yaEfv8+EVjDvYbEHtnit4=; 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=lrvheMBBE/V6wciJVZ3QDiFX5zurockrxvjfpsIDFVVrcB7Ma9r4eMZC6z4+oPyGG haKAiweaMqKWOBM/O6j6Gf7HhMMaa9sVP3k4w7Cewi1yQCPWk6r0+ALy1QUXy3GwgX 9CtiwkKOzUYHDjx3tnATWTkffrHENocenZMsUKLAnOwXXajdY6cHnyPMyI8XgwUcUh 0MO3GShhXvLCK19Es2JOh2FGPBP2aHy+jenkIXCUwyk+9rC8WEMkM5AzpoqH9f19vV 3lgYqKIYpVQkNTfmaxwYn5cdQlSBRlCwZJdf51WrfzZQBbYx8PJrtfjIWLjqBzNaNX HTU4Pk35rD0yg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 61EE36833B for ; Sat, 4 Apr 2026 15:32:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775338350; bh=rPLSwFHWlHYr6YIpIy4M4BXAQu+pD5wmFzJp5ENZnBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppRcWs2yLcur3+9bh5qWZOo/jHwjR8x61iOYnZ0YMmLJjw31tWN7AyMysFSXLCPLt HpLIevHgWlBYRiUqyXAuAD3vlWElQK5P0NXHKTF4flGSd+6pZUbuJc1cHwA12at/h1 r8BMu8ZwlP3fk7sjM2gQz96iKeYVqmGGYVYrc5s3NGBhht22vF4PlniYpDZLcXlNO5 VTkycodWkNLOFlRL0hOjbFN/xC9JHyuJYMSbaVRxXNabxuVCUR5V6TWY7k7fb6H9cW sJ7x+Zf/zc/+c0vI1GvYL2xMfwyWuFYCTmbIZrMIVkyEcnCgVAPD1ds5vnBBUydho8 78LdH6mW6DpIg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1B565FC8F; Sat, 4 Apr 2026 15:32:30 -0600 (MDT) 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 vBUJ9xHwDYJ6; Sat, 4 Apr 2026 15:32:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775338346; bh=bEpJToIk9mSTcnio3S8XbaXO1EwA2ejolpEM3G4j2rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G6JuWfZ1Cd+3UGZoR3Nik3bPf5WJdtu0isw4KKnx2h1XTTckawlrj3iq/zubj9kvx knBjLqzEWVBAD0pwBaF8jFeQFH70W4dYexee3h11FSmK2WYJMj/SS9yb+pXzbQjhWS NOzIcn8zWYFvBU/PXgABFVYl21gOV55BxKpFO/PLet/woinYgh29zxyQlwvyI++qLE Vl5RarHawbvk1VQXXfyMfzHGlKrHRSPjrA51HhyFEGv9+X1BbuRkMPJ1ZzcMX+61B+ IQaGtqp8tHJLQr9zLEqqhXBmjx7uwKdrMvKQkYuGXga1OeyDqoTiRUCrYwNC4Pns1M HTbLL8pq0M3nA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3EA4B5E7B4; Sat, 4 Apr 2026 15:32:26 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sat, 4 Apr 2026 15:28:58 -0600 Message-ID: <20260404213020.372253-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260404213020.372253-1-sjg@u-boot.org> References: <20260404213020.372253-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6ZCE764IZOHOMV3XWVCP4PBDCPKZQBIL X-Message-ID-Hash: 6ZCE764IZOHOMV3XWVCP4PBDCPKZQBIL 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/37] patman: Default autolink to updating the branch 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 Autolink stores the patchwork link in the database but does not update the Series-links tag in the commit unless -u is passed. This means 'patman status' cannot find the link since it reads from commit metadata. Change autolink and autolink-all to default to updating the commit, with --no-update to opt out. Update tests to match the new default. Signed-off-by: Simon Glass --- tools/patman/cmdline.py | 10 ++++++++-- tools/patman/test_cseries.py | 15 ++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py index 3843811729e..3c12200949f 100644 --- a/tools/patman/cmdline.py +++ b/tools/patman/cmdline.py @@ -260,7 +260,10 @@ def add_series_subparser(subparsers): auto = series_subparsers.add_parser('autolink', aliases=ALIASES['autolink']) - _add_update(auto) + auto.add_argument('-u', '--update', action='store_true', default=True, + help='Update the branch commit (default)') + auto.add_argument('--no-update', action='store_false', dest='update', + help='Do not update the branch commit') _add_wait(auto, 0) aall = series_subparsers.add_parser('autolink-all') @@ -268,7 +271,10 @@ def add_series_subparser(subparsers): help='Link all series versions, not just the latest') aall.add_argument('-r', '--replace-existing', action='store_true', help='Replace existing links') - _add_update(aall) + aall.add_argument('-u', '--update', action='store_true', default=True, + help='Update the branch commits (default)') + aall.add_argument('--no-update', action='store_false', dest='update', + help='Do not update the branch commits') series_subparsers.add_parser('dec') diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 5661e13e2e9..3b78399d907 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1402,7 +1402,7 @@ Tested-by: Mary Smith # yak with (mock.patch.object(cseries.Cseries, 'link_auto_all', return_value=None) as method): self.run_args('series', 'autolink-all', pwork=True) - method.assert_called_once_with(True, update_commit=False, + method.assert_called_once_with(True, update_commit=True, link_all_versions=False, replace_existing=False, dry_run=False, show_summary=True) @@ -1410,7 +1410,7 @@ Tested-by: Mary Smith # yak with (mock.patch.object(cseries.Cseries, 'link_auto_all', return_value=None) as method): self.run_args('series', 'autolink-all', '-a', pwork=True) - method.assert_called_once_with(True, update_commit=False, + method.assert_called_once_with(True, update_commit=True, link_all_versions=True, replace_existing=False, dry_run=False, show_summary=True) @@ -1418,7 +1418,7 @@ Tested-by: Mary Smith # yak with (mock.patch.object(cseries.Cseries, 'link_auto_all', return_value=None) as method): self.run_args('series', 'autolink-all', '-a', '-r', pwork=True) - method.assert_called_once_with(True, update_commit=False, + method.assert_called_once_with(True, update_commit=True, link_all_versions=True, replace_existing=True, dry_run=False, show_summary=True) @@ -1426,22 +1426,23 @@ Tested-by: Mary Smith # yak with (mock.patch.object(cseries.Cseries, 'link_auto_all', return_value=None) as method): self.run_args('series', '-n', 'autolink-all', '-r', pwork=True) - method.assert_called_once_with(True, update_commit=False, + method.assert_called_once_with(True, update_commit=True, link_all_versions=False, replace_existing=True, dry_run=True, show_summary=True) with (mock.patch.object(cseries.Cseries, 'link_auto_all', return_value=None) as method): - self.run_args('series', 'autolink-all', '-u', pwork=True) - method.assert_called_once_with(True, update_commit=True, + self.run_args('series', 'autolink-all', '--no-update', pwork=True) + method.assert_called_once_with(True, update_commit=False, link_all_versions=False, replace_existing=False, dry_run=False, show_summary=True) # Now do a real one to check the patchwork handling and output with terminal.capture() as (out, _): - self.run_args('series', 'autolink-all', '-a', pwork=pwork) + self.run_args('series', 'autolink-all', '-a', '--no-update', + pwork=pwork) itr = iter(out.getvalue().splitlines()) self.assertEqual( '1 series linked, 1 already linked, 1 not found (3 requests)',