Tortoise SVN hidden _svn folders
Asked Answered
C

9

13

They are specially annoying when I need to upload to the server a web solution.

Is there a way of configuring SVN to create the _svn folders outside my working directory? If not, what is the best way to deal with them when you need to copy only the code?

Update: Using "svn export" command is problematic because there are files that are not under source control but necessary like .dll's, xml data files or database files and they will not be exported. Therefore it would be required to manually copy them in there different subdirectories from the working copy each time.

Culture answered 21/10, 2008 at 14:55 Comment(5)
So, you might want to consider your server environment setup; if you have shell access, svn up'ing, and simply htaccess'ing the _svn folders to be non-public, might be an easier way of handling things.Neogaea
Why do you have files that aren't under source control? Maybe you should create a tag of the project and add those files to the tag. Then export the tag.Vetchling
Do the export and then build and deploy from the exported version.Ruffian
"there are files that are not under source control" I don't understand. If the files are not source controlled they are not in subversion. If they are not in subversion of course they will not be exported. What am I missing?Practitioner
@Bersek: They are excluded from source control because I don't want to track changes of them, for instance of a database file, but they need to be in the directory which is under source control.Culture
T
26

It's not (currently) possible to configure SVN (or TortoiseSVN) to create the .svn (or _svn) directories outside the working copy. I believe that the SVN 1.6 roadmap includes revisiting the working-copy library. The ability to put the administrative directories somewhere else might come out of this work, but I'm speculating.

You should use the "svn export" command to create a "clean" copy of your working copy (i.e. without the _svn directories). This works from the command line client.

If you're using TortoiseSVN, you can right-click on the working copy, and choose "Export...". This will ask you for a folder to export the files to. Alternatively, you can right-drag a working copy to a folder (one that's not a working copy), and TortoiseSVN will bring up a context menu; among the options are "SVN Export to here" and "SVN Export all to here", the latter also exporting files not under version control.

Tees answered 21/10, 2008 at 15:3 Comment(1)
it's now on the Subversion 1.7 roadmap; looks like there'll be one master .svn. Not sure if it can be configured to be outside of the WC in 1.7 yetSponson
U
17

Use "svn export" to create a clean directory tree.

Underact answered 21/10, 2008 at 14:58 Comment(1)
"Export" is in the tortoisesvn context menu, and I believe when you drag a versioned folder with the right mouse button to a folder, it offers to export to that folder.Recrystallize
D
12

Robocopy deployment...

robocopy {source} {dest} /MIR /XD _svn /XD .svn
Daumier answered 21/10, 2008 at 15:45 Comment(0)
L
4

In TortoiseSVN, you can right click on the working copy and drag it somewhere else. And when the popup menu appears, select "SVN Export Here". (This requires that all code in the working copy was checked in since the export will be from trunk and not from the working copy)

See these resources for details:

Loner answered 21/10, 2008 at 15:28 Comment(0)
B
3

if you use a nant script to enable deployment to the web server it has a _SVN and _SVN/** as automatic excludes when copying files. nant will filter out lots of unwaanted files when copying files via its copy task including:

  • **/*~
  • **/#*#
  • **/.#*
  • **/%*%
  • **/CVS
  • /CVS/
  • **/.cvsignore
  • **/.svn
  • /.svn/
  • **/_svn
  • /_svn/
  • **/SCCS
  • /SCCS/
  • **/vssver.scc
  • /_vti_cnf/

you can read more about NANT at its project home page here : NANT Home

Bandore answered 21/10, 2008 at 15:22 Comment(0)
D
2

+1 for the solution from Isak Savo.

And you can do an XCOPY and exclude "/svn" folders :

XCOPY %1 %1_deploy /EXCLUDE:C:\ExcludeSVN.txt /E /C /I /F /R /Y

Content of ExcludeSVN.txt :

/_svn

In fact, if you want to upoload to a web server, your exclude file can contains a lot more :

  • .pdb
  • .cs
  • .resx
  • .csproj
  • .sln
  • .webinfo
  • .bak
  • .sql
  • .zip
  • .vspscc
  • .vssscc
  • .scc
  • \Web.config

Warning : If you exclude .cs files, you gave to re-copy .css file after

Dextrad answered 21/10, 2008 at 15:34 Comment(1)
I know this is an old post, but you can use .cs\ to exclude .cs files and not .cssVeda
V
1

The really dirty way in Windows: Create a copy of your project, open Explorer, navigate to the directory the copy is in, and do a Find for everything ending with _svn. Once the search is done, select all and hit Delete.

Yuck! But it works really well.

Vetchling answered 21/10, 2008 at 15:20 Comment(0)
N
0

We use CruiseControl with robocopy in order to create a clean copy of your repository.

 <exec>
        <executable>C:\Archivos de programa\Windows Resource Kits\Tools\robocopy.exe</executable>
        <buildArgs>E:\CruiseControl\yourproject\Code\trunk\ E:\wwwroot\yourproject *.* /E /XX /XA:H /XO /NDL /NC /NS /NP /XF "*.cache" "*.designer.cs" "*.sln" "*.msbuild" "*.csproj" "*.PDB" "*.user" "*.designer" /XD .svn App_Code obj Properties</buildArgs>
        <buildTimeoutSeconds>60</buildTimeoutSeconds>
        <successExitCodes>1,0</successExitCodes>
 </exec>

/XF and /XD arguments excludes the files and the directories you don't want to upload to production.

You can find more info about robocopy here.

Natiha answered 21/10, 2008 at 15:47 Comment(0)
D
0

If you want to delete all sub folders named .svn in windows then create batch file with this content:

for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *.svn') do (
rd /s /q "%%i"
)

save it in a file del_All_Dot_SVN_Folders.cmd . Run it. Your done.

Thanks to http://www.axelscript.com/2008/03/11/delete-all-svn-files-in-windows/

Remember the above code has .svn whereas the code in the link has only *svn so its better to have the .svn to not accidentally have undesired effect.

Dehumanize answered 25/11, 2012 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.