summaryrefslogtreecommitdiff
path: root/tools/patman/cmdline.py
AgeCommit message (Collapse)Author
2025-05-27patman: Implement the upstream subcommandSimon Glass
Add a command to allow managing the upstream tree. This is very basic so far, only allowing setting the name and URL. Further work may allow checking whether series apply cleaning on the upstream tree, etc. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Implement the series subcommandSimon Glass
Add a command to support management of series. These are local branches which may have been sent to the mailing list, so may appear on the patchwork server. The new functionality uses a database, stored in a local file. Various operations are supported: - add a new series - send a series and automatically link it with patchwork - 'increment' the version, to prepare to send an updated series - gather review/test tags from patchwork - check on progress, i.e. patches which are received new tags or comments - show comments on patches and cover letters Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Support aliases for commands and subcommandsSimon Glass
It is laborious to type long commands, so add some aliases to speed up use of patman. For now, allow 'pw' for patchwork and 'st' for status. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Implement the patchwork subcommandSimon Glass
Add a command to allow setting and getting the patchwork project. This is needed so that patman can use the correct ID when talking to the patchwork server. To support testing, allow passing in the test database, patchwork object and Cseries object. Fake versions can then easily be provided for certain test cases. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Support returning the parsers to useSimon Glass
The parsing tests need to be able to try invalid arguments to make sure that these are handled correctly. Provide a way to return the parsers being used, as well as to pass in the parsers to use. This feature is needed in test_series_no_subcmd(), for example. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Use -c to show patch commentsSimon Glass
We chose -C as the flag to enable showing comments because -c was used in 'patman send' to specify the patch count. Now that the 'send' parser is separated we don't need to do this and it is OK to use the same flag in a different subcommand. We want to have a flag for cover-letter comments, so it makes most sense to have -C for that and -c for patch comments. Update the latter. Put this in a function since the new 'series' command will add this flag too. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Enhance implementation of file-based defaultsSimon Glass
Patman allows defaults for its command-line flags to be read from a file. The implementation of this does not fully work with subcommands, since we don't want a default for those. Also, it relies on being able to parse any sort of cmdline in order to figure out the options that are available. But in some cases, the cmdline may not parse, e.g. if there are required options, or conflicting options. Add a class which can be safely used to parse any cmdline, since it allows execution to continue even when errors are obtained. Use this to determine the defaults, being careful to skip sub/commands. Another way to handle all of this would be to maintain the defaults separately and insert them into the parser manually. For now, I'm not sure which is best. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Deal with git safe-directory warningSimon Glass
When running tests where the .git directory is not owned by the current user, various warnings are produced and the tests fail. This happens in CI. For patman itself, modify the gitutil.get_top_level() function to return None in this case. Ensure that the warning is not shown, since it creates about 1000 lines of output. For checkpatch, the same warning is produced even though --no-tree is given. Suppress that as well. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move -H out of the send commandSimon Glass
This is the help for the whole of patman, so move it to the start of the control function, rather than being inside 'patman send'. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move arguments for sent into the correct parserSimon Glass
Most of the arguments for the main parser are actually arguments for the 'send' parser. Move them there, in a separate function. Fix a pylint warning for -D and the imports while here. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Split subparsers into their own functionsSimon Glass
Simplify the main parser by moving subparser code into separate functions. Fix a few pylint warnings while here. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Split parser creation from parsingSimon Glass
Tests may want to parse their own arguments. Refactor the parser code to support this and allow settings to receive arguments as well. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Provide an option to run in single-threaded modeSimon Glass
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 <[email protected]>
2025-05-27patman: Support extra test featuresSimon Glass
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 <[email protected]>
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <[email protected]>
2023-11-14patman: Split out arg parsing into its own fileSimon Glass
Move this code into a separate cmdline module, as is done with the other tools. Use the same HAS_TESTS check as buildman Signed-off-by: Simon Glass <[email protected]>