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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
Simplify the main parser by moving subparser code into separate
functions. Fix a few pylint warnings while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
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 <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>
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>
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 <sjg@chromium.org>