Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to write load rule to recursively ignore certain file types

This is my component structure in my RTC workspace:

Component-A
|-- Root-Folder
    |-- Sub-Folder-1
         |-- File2.c
         |-- File2.doc
    |-- Sub-Folder-2
         |-- Sub-Folder-3
              |-- File3.c
              |-- File3.doc
    |-- File1.c
    |-- File1.doc

My requirement is to filter out all *.doc files and load only all *.c files into my sandbox like this:

My Sandbox path
|-- Root-Folder
    |-- Sub-Folder-1
         |-- File2.c
    |-- Sub-Folder-2
         |-- Sub-Folder-3
              |-- File3.c
    |-- File1.c

Learning from article: https://jazz.net/library/article/1015 I tried below load rules

1. using Exclude filter
------------------------------
<scm:sourceControlLoadRule version="1" xmlns:scm="http://com.ibm.team.scm">
    <excludeFilter>
        <filter name=".doc"/>
    </excludeFilter>
</scm:sourceControlLoadRule>

=> Error: Error parsing load rule: cvc-complex-type.2.4.b: The content of element 'scm:sourceControlLoadRule' is not complete. One of '{parentLoadRule, itemLoadRule}' is expected.
=> Why this error occurs ? It is not mentioned in the article 1015 that excludeFilter is dependent on parentLoadRule/itemLoadRule

2. using parentLoadRule and include filter
------------------------------------------------------------
<scm:sourceControlLoadRule version="1" xmlns:scm="http://com.ibm.team.scm">
    <parentLoadRule>
        <component name="Component-A"/>
        <parentFolder repositoryPath="/"/>
        <include>
            <filter pattern="*.c"/>
        </include>
    </parentLoadRule>
</scm:sourceControlLoadRule>

=> Error: There are no qualifying items under / in component Component-A to be loaded into sandbox
=> Why am I not able to use "/" as repositoryPath as shown in article 1015 ?

3. using parentLoadRule and include filter and setting repositoryPath
------------------------------------------------------------------------------------------
<scm:sourceControlLoadRule version="1" xmlns:scm="http://com.ibm.team.scm">
    <parentLoadRule>
        <component name="Component-A"/>
        <parentFolder repositoryPath="Root-Folder"/>
        <include>
            <filter pattern="*.c"/>
        </include>
    </parentLoadRule>
</scm:sourceControlLoadRule>

=> Status of sandbox after loading using this load rule:

My Sandbox path
|-- File1.c

=> This load rule just loads "File1.c" directly into my sandbox (It doesn't even create the "Root-Folder" inside my sandbox). Also, it is not recursive. File2.c, File3.c and their corresponding folder structure is not created inside my sandbox.

Could you please advice on how I could modify the above rule(s) to realize my requirement ? (I'm using RTC 4.0.6)

Thanks in advance.

0 votes

Comments
  1. using parentLoadRule,include filter, repositoryPath and sandboxRelativePath

    <scm:sourceControlLoadRule version="1" xmlns:scm="http://com.ibm.team.scm">;
    <parentLoadRule>
    <component name="Component-A"/>
         <parentFolder repositoryPath="Root-Folder"/>        
            <include>
                <filter pattern="*.c"/>
            </include>
            <sandboxRelativePath includeRepositoryPath="true"/>
        </parentLoadRule>
    </scm:sourceControlLoadRule>

    => Status of sandbox after loading using this load rule:
    My Sandbox path
    |-- Root-Folder
         |-- File1.c

    => Now "Root-Folder" gets created in my sandbox and only the File1.c is loaded inside it.
    => Only problem that has to be solved now is to find out how to load recursive



One answer

Permanent link
The "load recursively with a file pattern" is not supported by load rules yet.
Please see discussion https://jazz.net/forum/questions/154830/how-to-write-load-rule-to-recursively-ignore-certain-file-types and the work item https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/44004

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,025

Question asked: Jun 10 '14, 6:32 a.m.

Question was seen: 6,229 times

Last updated: Jun 10 '14, 8:40 a.m.

Confirmation Cancel Confirm