Age | Commit message (Collapse) | Author |
|
Add support to the status module for reading and supporting cover
letters, including comments. Plumb this through to the patchwork module.
The actual support in the latter is not yet integrated.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The func_test file is quite large. In order to allow new tests to be
added to a separate file, move the common test code into a separate
class, to be inherited by other classes.
Drop unnecessary imports in func_test
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add one more test for completeness, since this occurs commonly.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
If python2 is available then we must specify python3 here. Update the
test to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add a few tests to make sure that help is provided when requested.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Correct some pylint warnings in this file. Make use of the existing
asyncio event loop, instead of creating a new one, since this also
destroys it afterwards, making it unavailable for tests which want to
share an event loop. Use tools.write_file() to avoid a warning about
encoding.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
At present the branch information is dropped when writing the
configuration. It is easier to get git to set up the config anyway, so
update the test to do this.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The test starts with the HEAD pointing to the wrong place, so that the
created files appear to be deleted. Fix this by resetting the tree
before tests start. Add a check that the tree is clean.
Update pygit2 so that the enums are available.
|
|
Rather than hard-coding these values in the sample patches, use
variables so that we can refer to these in tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
In tests, the 'git' directory is a subdirectory of the temporary
directory. Rename it to '.git' so that git will automatically find it
when git operations are done in the temporary directory. Set up the
config before the first git operation, so that this works correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The variables 'lines' is used to hold a list of output lines within a
test, but also to hold an iterator through those lines. Use 'itr' for
the latter, to avoid confusion.
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>
|
|
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>
|
|
Rather than accessing the settings module in this function, require the
alias dict to be passed in.
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>
|
|
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>
|
|
Instead of passing the URL and function to each call, put the fake
into the Patchwork object instead.
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>
|
|
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>
|
|
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>
|
|
A quote character was added a few years ago, but was not intended. Drop
it.
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>
|
|
If a series is sent without a cover letter, there is no indication of
the base commit. Add support for this, since single patches of small
series may not always have a cover letter.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
It is helpful to know which commit patches are based on, even if that
commit might not be available to readers. Add a tag for this in the
cover letter.
Also add the local-branch name since that may be useful to the writer.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
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 <sjg@chromium.org>
|
|
When a patch is added to a series after the initial version, there are no
changes to note except that it is new. This is typically done to suppress
the "(no changes in vN)" message. It's also nice to add a change to the
cover letter so reviewers know there is an additional patch. Add a tag to
automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or
something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are
probably just noise in most series, but they may be useful for treewide
series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so
I've left them in.
Suggestions for the above appreciated.
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Most tags referring to commits (or patches) are named Commit-something. The
exception is Patch-cc. Add a Commit-cc alias so we can use whichever one is
convenient.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
|
|
If add_maintainers is set to False in the user's ~/.patman config, it will
cause the custom_get_maintainer_script to fail since that test expects
maintainers to be added. Set add_maintainer to True in the .patman config
to prevent this.
Fixes: 8c042fb7f9f ("patman: add '--get-maintainer-script' argument")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Variable orig_dir cannot be used in the finally block if it has not be
assigned outside of the try block.
tools/patman/func_test.py:523:21:
E0601: Using variable 'orig_dir' before assignment
(used-before-assignment)
tools/patman/func_test.py:691:21:
E0601: Using variable 'orig_dir' before assignment
(used-before-assignment)
Fixes: fd70986a62af ("patman: Add a test that uses gitpython")
Fixes: be051c0c7741 ("patman: Detect missing upstream in CountCommitsToBranch")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
This script can take ages on some series. Try to limit the time by
using threads. If a few stubborn patches remain, show progress so the
user has some idea what is going on.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
The patman directory has a number of modules which are used by other tools
in U-Boot. This makes it hard to package the tools using pypi since the
common files must be copied along with the tool that uses them.
To address this, move these files into a new u_boot_pylib library. This
can be packaged separately and listed as a dependency of each tool.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This makes it possible to configure a project to use some other
location or script than the default scripts/get_maintainer.pl one used
in the U-Boot and Linux projects. It can be configured via a .patman
configuration file and accepts arguments, as documented.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
Previously it would rely on the executing script location, which could
break for example when running the tests via 'pytest'.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
Fix pylint errors that can be fixed and mask those that seem to be
incorrect.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Convert this file to snake case and update all files which use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Convert this file to snake case and update all files which use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Convert this file to snake case and update all files which use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Convert this file to snake case and update all files which use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
In some communities, it may be necessary to append something after PATCH
in the subject line. For example, the Linux networking subsystem
expects [1] patch subject prefixes like [RFC PATCH net-next 0/99]. This
adds support for such "postfix"s to patman. Although entirely cosmetic,
it is still nice to have.
[1] https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html#how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
In some cases 'patman status' leaves a blank line between the sign-off
and the tags it collects from patchwork. Fix this and add a test.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add a error in patman tool when the commit message contents an invalid
tag "Serie-.*" instead of "Series-.*".
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Given that we have tests that require pygit2 and it can be installed
like any other python module, fail much more loudly if it is missing.
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
|
|
When a tag is used in a patch subject (e.g. "tag: rest of message") and
it cannot be found as an alias, patman currently reports a fatal error,
unless -t is provided, in which case it reports a warning.
Experience suggest that the fatal error is not very useful. Instead,
default to reporting a warning, with -t tell patman to ignore it
altogether.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
To enable use of patman with FSF/GNU projects, such as GCC or
Binutils, no Signed-off-by may be added. This adds a command
line flag '--no-signoff' to suppress adding signoffs in patman
when processing commits.
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fix patman testBranch() test:
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
We don't need these now that everything uses Python 3. Remove them and
the extra code in GetBytes() and ToBytes() too.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add a new argument to allow the URL of the patchwork server to be
speciified. For now this is hard-coded in the main file, but future
patches will move it to the settings file.
Signed-off-by: Simon Glass <sjg@chromium.org>
|