def GetBranchName(longname): # nightlies don't have a branch set (bug 570814) if not longname: return None allBranches = get_branches() shortname = longname.split('/')[-1] maybeBranch = '' for branch in allBranches: if shortname.startswith(branch): if len(branch) > len(maybeBranch): maybeBranch = branch if not maybeBranch: maybeBranch = 'Unknown' return maybeBranch
def __before__(self): self._branches_cache = get_branches() return super(SelfserveController, self).__before__()