summaryrefslogtreecommitdiff
path: root/tools/patman/patchstream.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-05 21:41:51 -0600
committerSimon Glass <sjg@chromium.org>2020-07-20 11:37:46 -0600
commite9799e0890339dcf9f816f7b904147f791fca011 (patch)
treeef6907830bc90d3c760eabc11ca4740507cee51b /tools/patman/patchstream.py
parent5d597584dbf027ce3e87d06001f5cbc2bde26eb2 (diff)
patman: Allow creating patches for another branch
Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/patchstream.py')
-rw-r--r--tools/patman/patchstream.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 4fe465e9ab8..2ea8ebcc3fd 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -512,17 +512,19 @@ def GetMetaDataForList(commit_range, git_dir=None, count=None,
ps.Finalize()
return series
-def GetMetaData(start, count):
+def GetMetaData(branch, start, count):
"""Reads out patch series metadata from the commits
This does a 'git log' on the relevant commits and pulls out the tags we
are interested in.
Args:
- start: Commit to start from: 0=HEAD, 1=next one, etc.
+ branch: Branch to use (None for current branch)
+ start: Commit to start from: 0=branch HEAD, 1=next one, etc.
count: Number of commits to list
"""
- return GetMetaDataForList('HEAD~%d' % start, None, count)
+ return GetMetaDataForList('%s~%d' % (branch if branch else 'HEAD', start),
+ None, count)
def GetMetaDataForTest(text):
"""Process metadata from a file containing a git log. Used for tests