summaryrefslogtreecommitdiff
path: root/tools/patman/main.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-29 21:46:35 -0600
committerSimon Glass <sjg@chromium.org>2020-11-05 09:11:31 -0700
commitdc6df972c9ee2afefd937bee3771865012daccef (patch)
tree20343d5ae78a420010b60d482dba8e04171a03c1 /tools/patman/main.py
parentbe051c0c7741d67f5093f6b61b64c45eb200235b (diff)
patman: Support checking for review tags in patchwork
Before sending out a new version of a series for review, it is important to add any review tags (e.g. Reviewed-by, Acked-by) collected by patchwork. Otherwise people waste time reviewing the same patch repeatedly, become frustrated and stop reviewing your patches. To help with this, add a new 'status' subcommand that checks patchwork for review tags, showing those which are not present in the local branch. This allows users to see what new review tags have been received and then add them. Sample output: $ patman status 1 Subject 1 Reviewed-by: Joe Bloggs <joe@napierwallies.co.nz> 2 Subject 2 Tested-by: Lord Edmund Blackaddër <weasel@blackadder.org> Reviewed-by: Fred Bloggs <f.bloggs@napier.net> + Reviewed-by: Mary Bloggs <mary@napierwallies.co.nz> 1 new response available in patchwork The '+' indicates a new tag. Colours are used to make it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/main.py')
-rwxr-xr-xtools/patman/main.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/patman/main.py b/tools/patman/main.py
index d1a43c44fcd..7f4ae1125a1 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -90,6 +90,10 @@ test_parser.add_argument('testname', type=str, default=None, nargs='?',
help="Specify the test to run")
AddCommonArgs(test_parser)
+status = subparsers.add_parser('status',
+ help='Check status of patches in patchwork')
+AddCommonArgs(status)
+
# Parse options twice: first to get the project and second to handle
# defaults properly (which depends on project).
argv = sys.argv[1:]
@@ -157,3 +161,17 @@ elif args.cmd == 'send':
else:
control.send(args)
+
+# Check status of patches in patchwork
+elif args.cmd == 'status':
+ ret_code = 0
+ try:
+ control.patchwork_status(args.branch, args.count, args.start, args.end)
+ except Exception as e:
+ terminal.Print('patman: %s: %s' % (type(e).__name__, e),
+ colour=terminal.Color.RED)
+ if args.debug:
+ print()
+ traceback.print_exc()
+ ret_code = 1
+ sys.exit(ret_code)