Alex K.
Alex K.

Reputation: 727

SVN commands to create remote folders and files with content

I currently work on a setup script (.cmd file) for my application. When used, this script shall create a cmd, which creates folders and files in a remote SVN repository. The current command I use is:

svn mkdir -m "Setup" ".$svn_root_repository."/NEW_FOLDER1"

where $svn_root_repository is a remote SVN repository.That command creates the new folder NEW_FOLDER1 in the repository, no problem so far.

With that command I do a commit directly. What I really want is to create and commit multiple folders at once (also files with content). Is there a way to create them on-the-fly?

The repository I want to create the folders in is NOT the same as where the .cmd file (which currently contains the svn commands) lies, so I can't use svn add, because svn add adds, as far as I know, only in the same repository. Or is there something like an optional parameter?

Upvotes: 2

Views: 5500

Answers (2)

randy-wandisco
randy-wandisco

Reputation: 3659

It sounds like svn import might do the trick?

http://svnbook.red-bean.com/en/1.7/svn.tour.importing.html#svn.tour.importing.import

Upvotes: 4

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200503

Quoting from svn mkdir --help:

1. Each directory specified by a working copy PATH is created locally
   and scheduled for addition upon the next commit.

2. Each directory specified by a URL is created in the repository via
   an immediate commit.

So AFAICS your only alternative is: check out the project, create the directories locally, then commit all your changes at once.

Upvotes: 3

Related Questions