Support specifying the git-directory when creating and sending patches.
This will allow better testing of this functionality, since we can use a
test directory.
For count_commits_to_branch() support an end commit while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Plumb a current-working-directory (cwd) through from send all the way to
the command gitutil libraries. This will allow better testing of this
functionality, since we can use a test directory.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some files are missing from the __all__ list, so add then. Reformat the
list to use more of the width of each line.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use --decorate to quickly detect the upstream branch, since this is much
faster than using 'git name-rev' on every possible commit.
Signed-off-by: Simon Glass <sjg@chromium.org>
For testing it is useful to be able to set the current directory used
for git operations, as well as the git-repo directory. Update some of
the functions to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current approach to calling 'git send-email' puts double quotes
around each email address to ensure that it will pass the shell
correctly. This is a bit cumbersome and requires using a shell to sort
it all out.
Drop the quotes and use command.run() instead, to simplify things. This
will also make it possible to (later) set the current directory.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is convenient to be able to print a message and exit. Add a new
'fatal' level to support this.
Update some assumptions about the level, so that the tools continue to
work as now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Instead of using settings.alias pass this value in. This allows tests to
work without using settings.alias
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than accessing settings directly, pass the aliases in, so that
we can do the same from tests. With further work this will allow the
tests to work without using settings.alias
Signed-off-by: Simon Glass <sjg@chromium.org>
The gitutil module is supposed to be independent from patman but one
piece was missed in the series which separated them.
Move the settings setup out of gitutil
Signed-off-by: Simon Glass <sjg@chromium.org>
The pager makes it easier to review large number of comments. Add it
around the output.
Patman normally sends multiple concurrent requests to the patchwork
server, as this is faster. Provide an option to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Patman normally sends multiple concurrent requests to the patchwork
server, as this is faster. Provide an option to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Now that all the pieces are in place, switch over from using an executor
to using asyncio.
While we are here, import defaultdict to avoid needing to specify its
module.
Signed-off-by: Simon Glass <sjg@chromium.org>
Import defaultdict to avoid needing to specify its module in multiple
places. Fix an extra blank line while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
When comments are shown below patches it can be hard to see the patch
subject. Use yellow instead of blue, since it stands out better.
Pass the colour object into show_responses() rather than creating a new
one, since that is tidier.
Signed-off-by: Simon Glass <sjg@chromium.org>
This test uses the find_new_responses() function which combines
accessing patchwork and processing the results.
Since the test is aimed at testing processing, adjust it to call
process_reviews() instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function does patchwork calls and then processes the results. Move
the processing out so we can (later) test it separately.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function has three phases:
- collecting things from patchwork
- doing some processing
- showing the results to the user / creating a branch
Refactor into two functions so we can eventually have the patchwork part
fully separated out.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function actually shows the status and does some other things.
Rename it to better reflect its purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
Expand the patchwork module so that it can match the current
requirements of the 'patman status' command, i.e. reading the state of a
series and the patches associated with it.
Since the format of each patchwork response is a little tricky to
understand, add examples in comments at the top of each function.
Signed-off-by: Simon Glass <sjg@chromium.org>
These relate to information obtained from the patchwork server, so move
their definition into the new patchwork module.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present the patchwork implementation is very simple, just consisting
of a function which calls the REST API.
We want to create a fake patchwork for use in tests. So start a new
module to encapsulate communication with the patchwork server.
Use asyncio since it is easier to handle lots of concurrent requests
from different parts of the code.
Signed-off-by: Simon Glass <sjg@chromium.org>
The control module includes much of the implementation of patman's
'send' feature. As a first step to separating this out, move the sending
code into its own file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide support for the -X flag, which preserves the working directory
used by tests. Also support -N which shows captured output for tests.
Finally, allow selection of a particular test to run.
Signed-off-by: Simon Glass <sjg@chromium.org>
Much of this was written before the other Python tools and they have
evolved. Make a few updates:
- Rather than calling sys.exit(), return the exit code from the control
module and use it in __main__
- Set up tout as it is used in some places
- We now have quite a few tests, so update the comment about that
Signed-off-by: Simon Glass <sjg@chromium.org>
This currently has the same name as a test in func_test.py so it isn't
possible to select one or the other with 'patman test test_basic': both
are executed.
Rename this one to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
When running tests there is no situation in which we want ANSI output as
it makes it much harder to see what is going on in logs, tests, etc.
Provide a way to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no point in spinning up multiple processes if there is only one
test to execute. Add a check for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is useful to have a pager when outputting a lot of text. Add support
for this in the terminal library, making use of a context manager.
Also add a function to indicate whether the output device is a terminal
or not, while we are here, to avoid duplicating this code.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current implementation does not handle background colours very well:
- It outputs an incorrect code in some cases, leading to wrong colours
- Some functions lack a control for the background
Tidy this up so that background colours can be used in more places.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tests often capture output so they can check it. This means that if the
test fails it is not easy to see what the output actually was.
Add a -N flag which writes out the output after it has been captured.
This is not a perfect solution but it is simple and seems to work well
in practice.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is sometimes useful outside tests. Also it can affect how
terminal output is done, e.g. whether ANSI characters should be emitted
or not.
Move it out of the test_util package and into terminal.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is easier for tests if the top-level control logic is all in one
module. Create a new do_patman() function to handle this. Move the
existing code into it.
Signed-off-by: Simon Glass <sjg@chromium.org>
The end-at-4gb property implies a value for skip-at-start so add it into
the output FDT so that U-Boot can read it.
Now that skip-at-start is implemented, we can drop the workarounds used
in the x86 code to obtain the correct image-pos value.
Signed-off-by: Simon Glass <sjg@chromium.org>
This value provides an offset for all image-pos values in the image.
Read it on startup so that we can take account of it when calculating
positions.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present buildman only supports building the default target. Generally
this is what is wanted, but in some cases boards erroneously have a
different target for product extra files.
Add a --target option to help. Also add a comment indicating which
letters are free for new options.
Signed-off-by: Simon Glass <sjg@chromium.org>
UEFI:
* run dhcp if an http boot option is selected
* separate device path into its own header and add it to the API docs
* rename END to EFI_DP_END
* make x86 SMBIOS tables usable in the EFI context
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmgy9UgACgkQhO4vgnE3
U0skjRAAtlyfJN+s4y7eTdrXzdkYK12zv+CEFJnBTm/QGVrm/sP3QWpe4NPJgqWq
3oLaKxDn0WaMNIEof8aoVMry/p42p4SLgw7+rbTRZn3ZH0WRu8MYVq9SDAbRZ9Km
eGsTtrVt43MdF++2Xx+j9NUGE3nYB+7X9AjvB7S3aH9WL+aU8ZBLv1xHvukM6dlT
/XdtsnYMBmpvlWB3q0/KM47LNTdsdYQPfoL/XRYfk+iIcBgnQbjRcdcI70yj8imb
AChf+78LWTR4YdMGqWJ5gMvvEFJK0QerGypOf37GgVHU10894CvaFSkyRkxMU6kM
fXb/0ZP9hMAFAuj52CgHt4dXu/vC0XOZHTciiYYLR6v4V+20errpxe8iR5KAcGXg
2Tl216wl5I/KqTkMHlS0etrnRTwKsAby/jUoQy4g5WmhTB6aBTbD//wbhCq4IFg8
w2BXFXt7egQ3Ppm48bNV6aKiap5+1TCDDxh9Cunwq62RXy5UQAyXWLoDYFwH0/Zq
7D61m7VW+kSCgQqoiKF4u6TmOW0NiQqDSmLVkHF4APcqWOB2R9fbTB8yabK9v/I+
DeLjF06Q6GP2N8JCqvelgiuxy+ee8ujR4rl7kYp1JprbUk8BNAOSIsYnUSux+ZQj
GjEQdyLf/rATsXp+5hfohTKyDmcyZm4XhPzND45gidcYqMd+Ovo=
=G4y4
-----END PGP SIGNATURE-----
Merge tag 'efi-2025-07-rc3-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-07-rc3-3
CI:
* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/26313
UEFI:
* run dhcp if an http boot option is selected
* separate device path into its own header and add it to the API docs
* rename END to EFI_DP_END
* make x86 SMBIOS tables usable in the EFI context
The way we enable ULPI support today isn't something that should work.
The "optional" keyword in a choice statement is not a documented
feature. To make this work in a supported way, make USB_ULPI something
we ask about if USB_HOST is set. Next, we move the choice of what
viewer to use to be after the framework portion and to depend on that.
We then borrow a few words from the top-level README to make the help
text here clearer. Finally we make the Qualcomm driver select ULPI as
it's required and we make the tegra driver not duplicate a check that
Kconfig now handles for us.
Signed-off-by: Tom Rini <trini@konsulko.com>