* [scarthgap][PATCH 1/2] devtool: standard: fix update-recipe/finish --initial-rev override
@ 2026-10-02 1:08 Babanpreet Singh
2026-10-02 1:08 ` [scarthgap][PATCH 2/2] oeqa/selftest/devtool: cover update-recipe --initial-rev Babanpreet Singh
0 siblings, 1 reply; 2+ messages in thread
From: Babanpreet Singh @ 2026-10-02 1:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Yoann Congal, Julien Stephan, Babanpreet Singh
Passing --initial-rev to update-recipe or finish currently has no
effect: the recorded initial revision is skipped as intended, but the
override is never stored in its place. For recipes without submodules
this leaves no initial revision at all, and the command fails with an
error asking the user to pass --initial-rev.
Seed initial_revs with the override before parsing the bbappend so it
takes precedence again. Recorded values are still used for submodules
and when no override is given.
AI-Generated: Uses Claude (claude-fable-5)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 62abb60b899e63ea6db5c745f4b1b6af0d4b40f1)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
scripts/lib/devtool/standard.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index e1e519ce5b..d5313921f2 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1254,6 +1254,10 @@ def _get_patchset_revs(srctree, recipe_path, initial_rev=None, force_patch_refre
commits = {}
patches = []
initial_revs = {}
+ if initial_rev:
+ # A user-specified override applies to the main repo ("."); the
+ # parse loop below leaves it in place of the recorded value
+ initial_revs["."] = initial_rev
with open(recipe_path, 'r') as f:
for line in f:
pattern = r'^#\s.*\s(.*):\s([0-9a-fA-F]+)$'
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [scarthgap][PATCH 2/2] oeqa/selftest/devtool: cover update-recipe --initial-rev
2026-10-02 1:08 [scarthgap][PATCH 1/2] devtool: standard: fix update-recipe/finish --initial-rev override Babanpreet Singh
@ 2026-10-02 1:08 ` Babanpreet Singh
0 siblings, 0 replies; 2+ messages in thread
From: Babanpreet Singh @ 2026-10-02 1:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Yoann Congal, Julien Stephan, Babanpreet Singh
The --initial-rev option had no selftest coverage. Extend
test_devtool_update_recipe to run update-recipe with --initial-rev
set to the recorded initial revision, which should match the default
output, and to a revision partway through the local commits, which
should export only the commits after it.
AI-Generated: Uses Claude (claude-fable-5)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 171af3b2915dd076c8d1b205ff75eac1ebd5a586)
[Adjusted for scarthgap: also takes the cleanup_cmd change to this test
from de635a9bc0 ("mdadm: fetch from git"), which the new steps rely on]
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
meta/lib/oeqa/selftest/cases/devtool.py | 27 ++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 6af3e2417a..cace9d26bd 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1186,13 +1186,38 @@ class DevtoolUpdateTests(DevtoolBase):
result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
result = runCmd('git add devtool-new-file', cwd=tempdir)
result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
- self.add_command_to_tearDown('cd %s; rm %s/*.patch; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ cleanup_cmd = 'cd %s; rm %s/*.patch; git add %s; git checkout %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile))
+ self.add_command_to_tearDown(cleanup_cmd)
result = runCmd('devtool update-recipe %s' % testrecipe)
result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
('A ', '.*/0001-Change-the-README.patch$'),
('A ', '.*/0002-Add-a-new-file.patch$')]
self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # Now try the same passing --initial-rev: the recorded initial
+ # revision must give the same result as not passing the option, and a
+ # later revision must export only the commits after it
+ result = runCmd('git rev-parse devtool-base', cwd=tempdir)
+ initial_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (initial_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Change-the-README.patch$'),
+ ('A ', '.*/0002-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ result = runCmd('git rev-parse HEAD~1', cwd=tempdir)
+ midpoint_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (midpoint_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
def test_devtool_update_recipe_git(self):
# Check preconditions
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-02 1:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 1:08 [scarthgap][PATCH 1/2] devtool: standard: fix update-recipe/finish --initial-rev override Babanpreet Singh
2026-10-02 1:08 ` [scarthgap][PATCH 2/2] oeqa/selftest/devtool: cover update-recipe --initial-rev Babanpreet Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox