tags:

views:

486

answers:

3

Hi,

I am looping though my folders and need to exclude the svn folders. I thought I could simply add the exclude element, though that doesnt seem to work.

<foreach item="Folder" property="foldername">
    <in>
        <items>
                <include name="YOUR_FOLDER\**" />
                <exlcude name="YOUR_FOLDER\**/_svn" />
        </items>
    </in>
    <do>
        <foreach item="File" property="filename" in="${foldername}">
        <do>
                <echo message="${filename}" />
        </do>
        </foreach>                              
    </do>
</foreach>

Can somebody help?

+1  A: 

It works when adding simply:

<exclude name="YOUR_FOLDER\**_svn**" />
vikasde
Where should I add this? Can you provide a full example or adjust your question accordingly please?
tobsen
A: 
<copy failonerror="true" overwrite="true" todir="${BusinessServicesTarget}">
        <fileset basedir="${BusinessServicesPath}">
            <exclude name="*.*" />  
            <include name="/**/*.as?x" />
            <exclude name="/**/**_SVN**" />

You need to use it in copy function not in foreach.

Leszek Wachowicz
A: 

You'll want to include the .svn directories and everything in them as well, otherwise the exclude mask will only hit the .svn directories, but not .svn/prop-base, .svn/props, .svn/text-base and so on.

<foreach item="Folder" property="foldername">
    <in>
        <items>
            <include name="YOUR_FOLDER/**" />
            <exclude name="YOUR_FOLDER/**/.svn/**" />
            <exclude name="YOUR_FOLDER/**/_svn/**" />
        </items>
    </in>
    <do>
        <foreach item="File" property="filename" in="${foldername}">
        <do>
                <echo message="${filename}" />
        </do>
        </foreach>                              
    </do>
</foreach>

Also, are you really using the alternative _svn naming scheme for Subversion's data directories?

Cygon