Next: , Previous: Choosing a Change Source, Up: Change Sources

4.7.2 Configuring Change Sources

The master.cfg configuration file has a dictionary key named BuildmasterConfig['change_source'], which holds the active IChangeSource object. The config file will typically create an object from one of the classes described below and stuff it into this key.

Each buildmaster typically has just a single ChangeSource, since it is only watching a single source tree. But if, for some reason, you need multiple sources, just set c['change_source'] to a list of ChangeSources.

     s = PBChangeSource()
     c['change_source'] = [s]

Each source tree has a nominal top. Each Change has a list of filenames, which are all relative to this top location. The ChangeSource is responsible for doing whatever is necessary to accomplish this. Most sources have a prefix argument: a partial pathname which is stripped from the front of all filenames provided to that ChangeSource. Files which are outside this sub-tree are ignored by the changesource: it does not generate Changes for those files.

Repository and Project

ChangeSources will, in general, automatically provide the proper 'repository' attribute for any changes they produce. For systems which operate on URL-like specifiers, this is a repository URL. Other ChangeSources adapt the concept as necessary.

Many ChangeSources allow you to specify a project, as well. This attribute is useful when building from several distinct codebases in the same buildmaster: the project string can serve to differentiate the different codebases. Schedulers can filter on project, so you can configure different builders to run for each project.