summaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
Diffstat (limited to 'tools/buildman')
-rw-r--r--tools/buildman/README11
-rw-r--r--tools/buildman/control.py19
2 files changed, 26 insertions, 4 deletions
diff --git a/tools/buildman/README b/tools/buildman/README
index 8e7a68c..68456ce 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -699,6 +699,17 @@ build the selected boards and display build status as it runs (i.e. -v is
enabled automatically). Use -e to see errors/warnings as well.
+Building Ranges
+===============
+
+You can build a range of commits by specifying a range instead of a branch
+when using the -b flag. For example:
+
+ upstream/master..us-buildman
+
+will build commits in us-buildman that are not in upstream/master.
+
+
Other options
=============
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 2249b0f..e10ed86 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -123,14 +123,22 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
# problems introduced by the first commit on the branch.
col = terminal.Color()
count = options.count
+ has_range = options.branch and '..' in options.branch
if count == -1:
if not options.branch:
count = 1
else:
- count, msg = gitutil.CountCommitsInBranch(options.git_dir,
- options.branch)
+ if has_range:
+ count, msg = gitutil.CountCommitsInRange(options.git_dir,
+ options.branch)
+ else:
+ count, msg = gitutil.CountCommitsInBranch(options.git_dir,
+ options.branch)
if count is None:
sys.exit(col.Color(col.RED, msg))
+ elif count == 0:
+ sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+ options.branch))
if msg:
print col.Color(col.YELLOW, msg)
count += 1 # Build upstream commit also
@@ -172,8 +180,11 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
# to overwrite earlier ones by setting allow_overwrite=True
if options.branch:
if count == -1:
- range_expr = gitutil.GetRangeInBranch(options.git_dir,
- options.branch)
+ if has_range:
+ range_expr = options.branch
+ else:
+ range_expr = gitutil.GetRangeInBranch(options.git_dir,
+ options.branch)
upstream_commit = gitutil.GetUpstream(options.git_dir,
options.branch)
series = patchstream.GetMetaDataForList(upstream_commit,