0

My SVN Repository Layout...

Project_Name(root)/trunk
            /branches/
            /branches/new_feature_of_trunk1
            /branches/new_feature_of_trunk2
            /tags/
            /tags/ETC1
            /tags/ETC2

i was trying to make buildbot to build several branches of my repository like for example... /trunk and /branches/new_feature_of_trunk1 .This is how i code it

from buildbot.changes.svnpoller import SVNPoller, split_file_branches
source_code_svn_url='http://domain.com/svn/Project_Name/'
c['change_source'].append(
    SVNPoller(
        svnurl=source_code_svn_url,
        split_file=split_file_branches,
        pollinterval=60,
        histmax=10,
    )
)

def modified_files(change):
    for name in change.files:
        if name.endswith(".c"):
            return True
        elif name.endswith(".h"):
            return True
    return False

from buildbot import scheduler
from buildbot.changes.filter import ChangeFilter
s1=scheduler.AnyBranchScheduler(
    name="Project_Test",
    treeStableTimer=2*60,
    change_filter=ChangeFilter(
        branch=[
            'trunk',
            'branches/new_feature_of_trunk1'
        ]
    ),
    builderNames=[
        "Windows-x64-VS10",
    ],
    fileIsImportant=modified_files
)

c['schedulers']=[s1]

from buildbot.process import factory
from buildbot.steps import source,shell
from buildbot.process.properties import WithProperties
from buildbot.config import BuilderConfig
step_source_svn=source.SVN(
    mode='copy',
    baseURL=source_code_svn_url,
    defaultBranch='trunk',
    retry=(30,2)
)

f2=factory.BuildFactory()
f2.addStep(step_source_svn)
f2.addStep(
    shell.Compile(
        command=[
            "devenv.com",
            "MakeMe.sln",
            "/build",
            "Release^|Win32"
        ],
        logEnviron=False
    )
)

The problem is this.. i know i added defaultBranch='trunk'. but why it only checkout trunk not the whole root? then whenever i remove it defaultBranch. i got this error

exceptions.RuntimeError: The SVN source step belonging to builder 'Windows-x64-VS10' does not know which branch to work with. This means that the change source did not specify a branch and that defaultBranch is None.

then the code i posted is for my buildmaster to tell the slave to build if there is modified_files in /trunk or /branches/new_feature_of_trunk1.. if there is modified in both branches in same SVN Revision. then it will compile /trunk first before /branches/new_feature_of_trunk1...

but as what i said it doesn't work like what i want

KeiKun
  • 35
  • 9

2 Answers2

0

If a single change set contains changes in both branches, then two changes should be created, and one build triggered for each change.

Tom Prince
  • 682
  • 3
  • 9
0

Old post I know, but for anyone else who comes this way, this might help:

You need to create schedulers for your branches. Right now it looks like you only have the one branch building, but if you have a scheduler that passes the branch it may go better for you.

Nightly(name="new1",          builderNames=["Project_Test"], branch="branches/new_feature_of_trunk1", onlyIfChanged=True, hour=range(0, 24, 2)),
Nightly(name="new2",          builderNames=["Project_Test"], branch="branches/new_feature_of_trunk2", onlyIfChanged=True, hour=range(0, 24, 2)),

If you are looking to checkout everything at once and your compile step makes all of the branches, your source_code_svn_url needs to be one branch higher

Silas Greenback
  • 1,200
  • 8
  • 15