mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 07:27:12 +00:00
yocto-bsp: allow branch display filtering
Add a "branches_base" property that can be used to allow only matching branches to be returned from all_branches(). Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
717704d12c
commit
b123553c1a
@@ -711,6 +711,16 @@ def all_branches(context):
|
||||
tmp = os.popen(gitcmd).read()
|
||||
|
||||
branches = []
|
||||
base_prefixes = None
|
||||
|
||||
try:
|
||||
branches_base = context["branches_base"]
|
||||
if branches_base:
|
||||
base_prefixes = branches_base.split(":")
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
arch = context["arch"]
|
||||
|
||||
if tmp:
|
||||
tmpline = tmp.split("\n")
|
||||
@@ -719,6 +729,14 @@ def all_branches(context):
|
||||
break;
|
||||
idx = line.find("refs/heads/")
|
||||
kbranch = line[idx + len("refs/heads/"):]
|
||||
kbranch_prefix = kbranch.rsplit("/", 1)[0]
|
||||
|
||||
if base_prefixes:
|
||||
for base_prefix in base_prefixes:
|
||||
if kbranch_prefix == base_prefix:
|
||||
branches.append(kbranch)
|
||||
continue
|
||||
|
||||
if (kbranch.find("/") != -1 and
|
||||
(kbranch.find("standard") != -1 or kbranch.find("base") != -1) or
|
||||
kbranch == "base"):
|
||||
|
||||
Reference in New Issue
Block a user