[PATCH 7/7] patman: Add a Series-patchwork-url option
Simon Glass
sjg at chromium.org
Tue Nov 3 21:54:16 CET 2020
Add a commit tag to allow the Patchwork URL to be specified in a commit.
This can be handy for when you submit code to multiple projects but don't
want to use the -p option.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
tools/patman/README | 6 ++++++
tools/patman/control.py | 7 ++++++-
tools/patman/series.py | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/patman/README b/tools/patman/README
index 639c9943ace..6b806632f8c 100644
--- a/tools/patman/README
+++ b/tools/patman/README
@@ -208,6 +208,12 @@ Series-links: [id | version:id]...
branch against patchwork to see what new reviews your series has
collected ('patman status').
+Series-patchwork-url: url
+ This allows specifying the Patchwork URL for a branch. This overrides
+ both the setting files and the command-line argument. The URL should
+ include the protocol and web site, with no trailing slash, for example
+ 'https://patchwork.ozlabs.org/project'
+
Cover-letter:
This is the patch set title
blah blah
diff --git a/tools/patman/control.py b/tools/patman/control.py
index a3c50cd9c52..2330682df4a 100644
--- a/tools/patman/control.py
+++ b/tools/patman/control.py
@@ -196,7 +196,8 @@ def patchwork_status(branch, count, start, end, dest_branch, force,
force (bool): With dest_branch, force overwriting an existing branch
show_comments (bool): True to display snippets from the comments
provided by reviewers
- url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org'
+ url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org'.
+ This is ignored if the series provides a Series-patchwork-url tag.
Raises:
ValueError: if the branch has no Series-link value
@@ -225,6 +226,10 @@ def patchwork_status(branch, count, start, end, dest_branch, force,
if not found:
raise ValueError('Series-links has no current version (without :)')
+ # Allow the series to override the URL
+ if 'patchwork_url' in series:
+ url = series.patchwork_url
+
# Import this here to avoid failing on other commands if the dependencies
# are not present
from patman import status
diff --git a/tools/patman/series.py b/tools/patman/series.py
index 4457719f2ef..1d92bdb9103 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -16,7 +16,7 @@ from patman import tools
# Series-xxx tags that we understand
valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',
- 'cover_cc', 'process_log', 'links']
+ 'cover_cc', 'process_log', 'links', 'patchwork_url']
class Series(dict):
"""Holds information about a patch series, including all tags.
--
2.29.1.341.ge80a0c044ae-goog
More information about the U-Boot
mailing list