aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/control.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/control.py
parent5d597584dbf027ce3e87d06001f5cbc2bde26eb2 (diff)
downloadu-boot-e9799e0890339dcf9f816f7b904147f791fca011.zip
u-boot-e9799e0890339dcf9f816f7b904147f791fca011.tar.gz
u-boot-e9799e0890339dcf9f816f7b904147f791fca011.tar.bz2
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/control.py')
-rw-r--r--tools/patman/control.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/patman/control.py b/tools/patman/control.py
index a896c92..b48eac4 100644
--- a/tools/patman/control.py
+++ b/tools/patman/control.py
@@ -20,7 +20,7 @@ def setup():
"""Do required setup before doing anything"""
gitutil.Setup()
-def prepare_patches(col, count, start, ignore_binary):
+def prepare_patches(col, branch, count, start, ignore_binary):
"""Figure out what patches to generate, then generate them
The patch files are written to the current directory, e.g. 0001_xxx.patch
@@ -28,6 +28,7 @@ def prepare_patches(col, count, start, ignore_binary):
Args:
col (terminal.Color): Colour output object
+ branch (str): Branch to create patches from (None = current)
count (int): Number of patches to produce, or -1 to produce patches for
the current branch back to the upstream commit
start (int): Start partch to use (0=first / top of branch)
@@ -42,7 +43,7 @@ def prepare_patches(col, count, start, ignore_binary):
"""
if count == -1:
# Work out how many patches to send if we can
- count = (gitutil.CountCommitsToBranch() - start)
+ count = (gitutil.CountCommitsToBranch(branch) - start)
if not count:
sys.exit(col.Color(col.RED,
@@ -50,9 +51,9 @@ def prepare_patches(col, count, start, ignore_binary):
# Read the metadata from the commits
to_do = count
- series = patchstream.GetMetaData(start, to_do)
+ series = patchstream.GetMetaData(branch, start, to_do)
cover_fname, patch_files = gitutil.CreatePatches(
- start, to_do, ignore_binary, series)
+ branch, start, to_do, ignore_binary, series)
# Fix up the patch files to our liking, and insert the cover letter
patchstream.FixPatches(series, patch_files)
@@ -158,9 +159,11 @@ def send(options):
setup()
col = terminal.Color()
series, cover_fname, patch_files = prepare_patches(
- col, options.count, options.start, options.ignore_binary)
+ col, options.branch, options.count, options.start,
+ options.ignore_binary)
ok = check_patches(series, patch_files, options.check_patch,
options.verbose)
+
its_a_go = ok or options.ignore_errors
if its_a_go:
email_patches(