It's all about the answers!

Ask a question

how to use loadrule with scm command for loading root folder and specific subfolders?


0
1
praveen patidar (8613344) | asked Jan 23 '13, 11:25 p.m.
Hello,

I have a requirement for loading the content of the workspace.
1. I want to load the root folder of each folder. (I have achieved that with itemLoadRule alternateName  attibute.)

2. I want to filter the loaded content as I want exclude test folders. (I have achived this with Filter in the parent loadRule).

Now My requirement is to do both the things together. because my component contains same subfolders and I want to exclude the testing related folders while loading.

Root folder load with filter- How to achieve this with using loadrule?



Comments
praveen patidar commented Jan 23 '13, 11:55 p.m. | edited Jan 23 '13, 11:55 p.m.

I have gone through the articles--
https://jazz.net/library/article/1016
https://jazz.net/library/article/1015

want to load
comp1\src
comp1\batch
comp1\bin

comp2\bin
comp2\src


exclude
comp1\test
comp2\test


praveen patidar commented Jan 24 '13, 12:04 a.m.

More over as I said I am able to load the component with the alternate name :

<scm:sourceControlLoadRule eclipseProjectOptions="create" version="1" xmlns:scm="http://com.ibm.team.scm">;
    <itemLoadRule alternateName="CBT_BATCH_ANT">
        <component name="CBT_BATCH_ANT"/>
        <!-- <component itemId="_Uf7awFuJEeKqQceOkLz-NA" /> -->
        <item repositoryPath="/"/>
        <!-- <item itemType="folder" itemId="_Uf7axFuJEeKqQceOkLz-NA" /> -->
    </itemLoadRule>
</scm:sourceControlLoadRule>



I need to add filter in the same functionality.


praveen patidar commented Jan 24 '13, 12:08 a.m.

Even the sandbox relative path is also not working with the exclude, :(

<sandboxRelativePath pathPrefix="/Robotics/packages/apps"/>


3 answers



permanent link
praveen patidar (8613344) | answered Feb 11 '13, 10:09 p.m.
The simplest way to create a folder named with the Component and go inside the folder using cd command. and then load the component only provided in the command line. Come out from the folder using cd.. and do the same for all. but for this approach you have to know all the components name in the loadrule file.

permanent link
Sudhakar Frederick (80113631) | answered Feb 11 '13, 9:54 p.m.
JAZZ DEVELOPER
edited Feb 11 '13, 10:02 p.m.
Hi Praveen
Is it possible that you can have the first folder in every component named the same as the component and have everything else under that? Then it seems easier to do what you want without having to load the component itself as a root folder. As you have found I can't figure out how to combine both an alternateName and filter in the same rule. In other words:
<?xml version="1.0" encoding="UTF-8"?><!--Built from the sandbox "C:\Users\IBM_ADMIN\lscm" and the workspace "al BRM Stream Workspace"--><!--Generated: 2013-02-12 13.33.02--><scm:sourceControlLoadRule version="1" xmlns:scm="http://com.ibm.team.scm">
    <itemLoadRule>
        <component name="Mobile"/>
        <!-- <component itemId="_oK61wD3cEeKeitO4pPkb-g" /> -->
        <item repositoryPath="/JKEBankMobile/apps"/>
        <!-- <item itemType="folder" itemId="_oewXwD3cEeKeitO4pPkb-g" /> -->
        <sandboxRelativePath includeRepositoryPath="true"/>
    </itemLoadRule>
    <itemLoadRule>
        <component name="Mobile"/>
        <!-- <component itemId="_oK61wD3cEeKeitO4pPkb-g" /> -->
        <item repositoryPath="/JKEBankMobile/server"/>
        <!-- <item itemType="folder" itemId="_6EQO0D3cEeKeitO4pPkb-g" /> -->
        <sandboxRelativePath includeRepositoryPath="true"/>
    </itemLoadRule>
    <itemLoadRule>
        <component name="Mobile"/>
        <!-- <component itemId="_oK61wD3cEeKeitO4pPkb-g" /> -->
        <item repositoryPath="/JKEBankMobile/adapters"/>
        <!-- <item itemType="folder" itemId="_oboLQD3cEeKeitO4pPkb-g" /> -->
        <sandboxRelativePath includeRepositoryPath="true"/>
    </itemLoadRule>
    <itemLoadRule>
        <component name="Mobile"/>
        <!-- <component itemId="_oK61wD3cEeKeitO4pPkb-g" /> -->
        <item repositoryPath="/JKEBankMobile/bin"/>
        <!-- <item itemType="folder" itemId="_pNSRsD3cEeKeitO4pPkb-g" /> -->
        <sandboxRelativePath includeRepositoryPath="true"/>
    </itemLoadRule>
    <parentLoadRule>
        <component name="Database"/>
        <!-- <component itemId="_oH3hyD3cEeKeitO4pPkb-g" /> -->
        <parentFolder repositoryPath="/JKEDBAccess"/>
        <!-- <parentFolder itemType="folder" itemId="_aS3EUD3dEeKeitO4pPkb-g" /> -->
        <exclude>
            <filter name=".settings"/>
        </exclude>
        <sandboxRelativePath includeRepositoryPath="true"/>
    </parentLoadRule>
     <parentLoadRule>
        <component name="C# UI"/>
        <parentFolder repositoryPath="/"/>
        <exclude>
            <filter name="obj"/>
        </exclude>
        <sandboxRelativePath includeRepositoryPath="true"/>
    </parentLoadRule>
    <parentLoadRule>
        <component name="Banking Logic"/>
        <!-- <component itemId="_n0_CAT3cEeKeitO4pPkb-g" /> -->
        <parentFolder repositoryPath="/JKEBusinessData"/>
        <!-- <parentFolder itemType="folder" itemId="_bEXZwD3dEeKeitO4pPkb-g" /> -->
        <exclude>
            <filter name=".settings"/>
        </exclude>
        <sandboxRelativePath includeRepositoryPath="true"/>
    </parentLoadRule>
    <parentLoadRule>
        <component name="Banking Logic"/>
        <!-- <component itemId="_n0_CAT3cEeKeitO4pPkb-g" /> -->
        <parentFolder repositoryPath="/JKEBusinessLogic"/>
        <!-- <parentFolder itemType="folder" itemId="_bKyK0D3dEeKeitO4pPkb-g" /> -->
        <exclude>
            <filter name=".settings"/>
        </exclude>
        <sandboxRelativePath includeRepositoryPath="true"/>
    </parentLoadRule>
</scm:sourceControlLoadRule>

Hope that helps somewhat.


permanent link
Sudhakar Frederick (80113631) | answered Jan 30 '13, 5:36 p.m.
JAZZ DEVELOPER
Hi Praveen
Shouldn't the "Loading with Filters" example from https://jazz.net/library/article/1015#filter help here?
<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
    <parentLoadRule>
        <component name="SCM Component"/>
        <parentFolder repositoryPath="/"/>
        <exclude>
            <filter name="experimental"/>
        </exclude>
    </parentLoadRule>
</scm:sourceControlLoadRule>


Comments
praveen patidar commented Jan 31 '13, 1:17 a.m.

I have tried this. As I said this is loading content but not creating folder for the component. so lets say I have src folder in two component. I cannot do this. If it is possible to use that and folder is created for component just like <itemLoadRule alternateName="CBT_BATCH_ANT"> I am ok with that.

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.