diff options
author | Simon Glass <sjg@chromium.org> | 2014-12-01 17:33:57 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-01-14 21:16:53 -0800 |
commit | 5abab20dfb20406137e8b7d659aee3cf43dff351 (patch) | |
tree | 2e3c4ef8baaa8a7adde284c6666c4b01770f9717 /tools/buildman/control.py | |
parent | 0740127f4d59564a8bdb64c59fb4f5c2357350f9 (diff) | |
download | u-boot-5abab20dfb20406137e8b7d659aee3cf43dff351.tar.gz |
buildman: Allow specifying a range of commits to build
Adjust the -b flag to permit a range expression as well as a branch.
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'tools/buildman/control.py')
-rw-r--r-- | tools/buildman/control.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 2249b0f700..e10ed867fb 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, |