How can I prevent named files in subdirectory from being loaded via "Load Rules" file?
I have a component called "CompA" with directory structure of:
/code
fileA.txt
fileB.txt
fileC.txt
/config
conf1.props
conf2.props
Can I use a load rules file to prevent fileC.txt from being loaded by developers? I've tried the following load rule file with no success:
<scm:sourceControlLoadRule eclipseProjectOptions="import" version="1" xmlns:scm="http://com.ibm.team.scm">
<parentLoadRule>
<component name="CompA"/>
<parentFolder repositoryPath="/"/>
<exclude>
<filter name="fileC.txt"/>
</exclude>
</parentLoadRule>
</scm:sourceControlLoadRule>
One answer
It looks like you've got the right idea, taken right from Loading with Load Rules in Rational Team Concert 4.0 and later, section Example: Loading with filters. It just looks like you're missing the XML declaration and the xmlns is an encoded link. Try the loadrules below.
Scott
<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
<parentLoadRule>
<component name="CompA"/>
<parentFolder repositoryPath="/"/>
<exclude>
<filter name="fileC.txt"/>
</exclude>
</parentLoadRule>
</scm:sourceControlLoadRule>
Comments
Dang! I can't seem to get the forum to display the xml declaration or the camel case, but you can see it in Example: Loading with filters.
The XML in the description looks right but I don't think the "exclude" tag will work on files. There article that Scott posted mentions the "excludeFilter" tag that looks like it will work on files. https://jazz.net/library/article/1015#excludeFilter
1 vote
Scott,
Tim,
Hi Chris,
I believe this will work for you,
<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
<excludeFilter>
<filter name="fileC.txt"/>
</excludeFilter>
<parentLoadRule>
<component name="CompA"/>
<parentFolder repositoryPath="/"/>
</parentLoadRule>
</scm:sourceControlLoadRule>
1 vote
FYI, I had to look at the Appendix : Load Rule schema to figure out where to put the excludeFilter element in relation to the parentLoadRule element, and the order matters.