Переход на константы-ветки

Mike Khiretskiy 9 years ago
parent 09e9adaed4
commit 5a345a36f6

@ -27,6 +27,7 @@ import time
from calculate.lib.configparser import ConfigParser
from calculate.lib.utils.files import (readFile, listDirectory, isMount,
writeFile)
from calculate.lib.utils.git import Git
from .datavars import BuilderError
from calculate.lib.utils.tools import Locker, LockError
from .datavars import builder_data
@ -59,8 +60,8 @@ class Build(object):
'references': References}
class Branches:
Stable = "master"
Unstable = "update"
Stable = Git.Reference.Master
Unstable = Git.Reference.Update
def __init__(self, build_id, distributive, parent, restore=False):
"""

@ -27,6 +27,7 @@ from calculate.lib.utils.files import isMount, process, typeFile, listDirectory,
pathJoin
from calculate.lib.utils.kernel import InitrdFile
from calculate.lib.utils.tools import max_default
from calculate.lib.utils.git import Git
from ..build_storage import BuildStorage, Build
from ..drive_spool import DriveSpool
from calculate.lib.datavars import Variable, VariableError, ReadonlyVariable, \
@ -1060,13 +1061,17 @@ class VariableClBuilderBranchName(Variable):
self.label = _("Branches")
def choice(self):
return ["master", "develop", "update", "binhost"]
return [
Git.Reference.Tag,
Git.Reference.Master,
Git.Reference.Develop,
Git.Reference.Update]
def get(self):
dv = self.Get('cl_builder_linux_datavars')
if dv:
if "getbinpkg" in self.Get('cl_features'):
return ["binhost" for x in dv.Get('cl_update_rep_name')]
return [Git.Reference.Tag for x in dv.Get('cl_update_rep_name')]
else:
branch = self.Get('cl_update_branch')
return [branch for x in dv.Get('cl_update_rep_name')]

Loading…
Cancel
Save