Filtered Source Control Block¶
The FilteredSourceControl allows you to filter out modifications that are used to trigger a build. If for example, you have certain files (such as web pages or document files) under source control that you don't want to have trigger the build, you can use this class to ensure that their changes will keep a new build from launching.
The FilteredSourceControl works together with all of the source controls supported by CCNet (including the Multi Source Control Block). It can also be included under the Multi Source ControlBlock provider so that you could have multiple FilterSourceControls each filtering a different set of modifications from different source control providers. Essentially, it acts as a decorator (or an example of the pipes and filters pattern ), wrapping around the specific SourceControl provider that you want to use.
The FilteredSourceControl includes both inclusion and exclusion filters for specifying what modifications should be included/excluded. Multiple inclusion and exclusion filters can be specified or, alternately, no inclusion or exclusion filter could be specified. If a modification is matched by both the inclusion and exclusion filter, then the exclusion filter will take preference and the modification will not be included in the modification set. It is relatively straightforward to build new filters, (such as one to filter modifications based on email address).
Available from version 1.0
1<sourcecontrol type="filtered"> 2 <sourceControlProvider type="vss" autoGetSource="true"> 3 <project>$/Kunigunda/ServiceLocator</project> 4 <workingDirectory>C:\CCNet\Kunigunda\ServiceLocator</workingDirectory> 5 <username>urosn</username> 6 <password></password> 7 <ssdir>c:\localvss</ssdir> 8 </sourceControlProvider> 9 <inclusionFilters> 10 <pathFilter> 11 <pattern>/Kunigunda/ServiceLocator/Sources/**/*.*</pattern> 12 </pathFilter> 13 </inclusionFilters> 14 <exclusionFilters> 15 <pathFilter> 16 <pattern>/Kunigunda/ServiceLocator/Sources/Kunigunda.ServiceLocator/AssemblyInfo.cs</pattern> 17 </pathFilter> 18 <pathFilter> 19 <pattern>/**/*.vssscc</pattern> 20 </pathFilter> 21 <userFilter> 22 <names> 23 <name>Perry</name> 24 <name>Joe</name> 25 </names> 26 </userFilter> 27 <actionFilter> 28 <actions> 29 <action>deleted</action> 30 </actions> 31 </actionFilter> 32 <commentFilter> 33 <pattern>Ignore: .*</pattern> 34 </commentFilter> 35 </exclusionFilters> 36</sourcecontrol>
|type||The type of source control block.||String - must be filtered||Yes||n/a||1.0|
|dynamicValues||The dynamic values to use for the source control block.||Dynamic Values array||No||None||1.5|
|exclusionFilters||The list of filters that decide what modifications to exclude.||Modification Filters array||No||None||1.0|
|inclusionFilters||The list of filters that decide what modifications to include.||Modification Filters array||No||None||1.0|
|sourceControlProvider||This element is used to specify the type of source control provider to retrieve modifications from. With the exception of the element name, the configuration for this element is identical to the xml configuration for the specific source control provider you intend to use.||Source Control Blocks||Yes||n/a||1.0|
Implemented and contributed by Uros Novak.
Documentation generated on Monday, 26 May 2014 at 7:18:02 AM