tags:

views:

78

answers:

6

Here is the problem:

Loop through all files and subfolders copying all contents EXCEPT .svn into another location.

I can think of some pretty hairy ways to do this but am wondering if anyone knows a real simple function to save me a bit of time? Thanks.

+3  A: 

Use rsync and the --exclude switch.

… although in this specific case, the better option is svn export

David Dorward
+9  A: 

You can use the svn export command. It will populate a target folder with the content of a working copy (or a revision on a repository).

xtofl
A: 

If you are using TortoiseSVN, use Export ...

Hightechrider
A: 

We sometimes uses Beyond Compare (http://beyond-compare.softonic.com/): select the root source directory and the destination one, exclude .svn and do a synchronization. This is useful if you need to do it again: saves the settings as a project.

aberta
+1  A: 

So my quick and dirty way of doing this recently was using python:

for root, dirs, files in os.walk(inRootDirArg):
        for d in dirs: 
            if d.startswith('.'):#excludes directories that start with '.'
                continue
            ...<logic to move your desired directories>...

This solution disregards any directory starting with a '.', but if i needed to be more specific it isn't difficult to modify it to omit just .svn directories.

jonny
+1  A: 

As others have said, svn export.

However, you could also do this easily using Xcopy and the exclude switch, see here:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

and here: http://commandwindows.com/xcopy.htm

The second link has a much better description of the exclude switch.

JasonS