It's all about the answers!

Ask a question

How to use RTC load rule excludeFilter

Zoe Slattery (4011720) | asked Dec 06 '15, 12:34 p.m.
Hi - I have a component that has directories like this:


I'd like to load just /root/fred/A/.. in an eclipse workspace, that is - I want everything except root/fred/B/* and root/fred/C/*.

I've tried this:

<scm:sourceControlLoadRule xmlns:scm="" eclipseProjectOptions="import" version="1">
        <filter name="root/fred/B" />
        <filter name="root/fred/C" />
<component name="C1"/>
     <parentFolder repositoryPath="/"/>
    <sandboxRelativePath includeRepositoryPath="true"/>

It just loads everything. Is there a way to do what I want? It looks as though excludeFilter should work (from this: so I think I probably have the syntax wrong. Does anyone have an example?

I'm using the RTC V5.0 client.

Thanks, Zoe

One answer

permanent link
Surya Tripathi (65017) | answered Dec 09 '15, 5:59 p.m.
edited Dec 09 '15, 6:06 p.m.
I believe the <excludefilter> considers only file or folder names. Your loadrule file is using a path instead. The filters "root/fred/B" and "root/fred/C" would not match any name and that is why everything is being loaded. 

You can try to use <itemLoadrule> instead. 
For example, the following load rule will load only folder /root/fred/A/ and the .project file at /root/fred (assuming this folder contains the .project file). If your .project file is at different location, you should also include that in the itemLoadRule, otherwise Eclipse project may not be created (the workspace should still be loaded in your sandbox.)

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;scm:sourceControlLoadRule xmlns:scm=&quot;; eclipseProjectOptions=&quot;import&quot; version=&quot;1&quot;&gt;
&lt;component name=&quot;C1&quot;/&gt;
&lt;item repositoryPath=&quot;Fred/.project&quot;/&gt;
&lt;sandboxRelativePath includeRepositoryPath=&quot;true&quot;/&gt;
&lt;component name=&quot;C1&quot;/&gt;
&lt;item repositoryPath=&quot;Fred/A&quot;/&gt;
&lt;sandboxRelativePath includeRepositoryPath=&quot;true&quot;/&gt;

Zoe Slattery commented Dec 11 '15, 5:00 a.m.

 So, if I had 100 folders and I wanted to load 98 and exclude 2, the only way to do this would be to list all 98 as items? 

I can see that the other possibility is to put the ones that I don't want into another component but I was hoping to find a solution without doing this.

Surya Tripathi commented Dec 11 '15, 4:58 p.m. | edited Dec 11 '15, 5:00 p.m.

In that case, you may have to specify the parent folder first using <parentFolder> tag -
<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="" version="1">
        <component name="C1"/>
        <parentFolder repositoryPath="root/fred"/>
            <filter name="B"/>
            <filter name="C"/>

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.