C # code to export SVN folder

I am looking for a simple C # script that will export an SVN folder.

note: I have a svn turtle installed on this r2 Win 2008 server.

Thanks for your help!

Example:

//SVN: string source = c:\project\websiteFiles\ //Export to: string target = c:\inetpub\hockeyWebsite\ ExportSVNfolder(source, target) { // export the files // wait till export is 100% complete // return } 
+4
source share
3 answers

Using the SharpSvn SvnClient export method , it is very simple:

 SharpSvn.SvnClient svnclient = new SvnClient(); svnclient.Export(new SvnUriTarget(source), target, new SvnExportArgs()); 
+8
source

I would recommend using SharpSVN .

+3
source

You can automate all TortoiseSVN commands through the command line, as described in the help files . Or you can directly install and invoke subversion binaries.

One thing you might want to consider is the fact that the export command will only copy version files (files that are under version control). If you have additional files that also need to be copied (e.g. build-output or generated files), I would recommend using a different approach, for example. for example, the command line solution (using xcopy ) shown by TheCatcher in this forum post :

  • Create a text file (e.g. c:\ignore.txt ) that lists all the files that should not be exported / copied (usually it contains only one line: .svn to exclude SVN folders).
  • Create a batch file containing the following command to export:
  • XCopy C:\WorkingCopyFolder C:\TargetFolder /EXCLUDE:C:\ignore.txt /E /C /I /F /R /Y
0
source

Source: https://habr.com/ru/post/1303563/


All Articles