Pietro
Pietro

Reputation: 13172

Subversion / SVN: can I import into a local repository/directory?

I am trying to create a brand new Subversion repository on my local drive, but after a successful svnadmin create, and the creation of the corresponding directory tree (conf/, db/, hooks/, locks/, format), I cannot run the svn import command:

> cd D:\TestPrj

> svnadmin create "D:/svn/test/"

> svn import . "D:/svn/test/"
svn: E205000: Too many arguments to import command

> svn import "D:/svn/test/"
svn: E205000: Too many arguments to import command

> svn import . "\\localhost\d\svn\test\"
svn: E020024: Error resolving case of '\\localhost\d\svn\test"'

> svn import . "file:///D/svn/test/"
svn: E205000: Too many arguments to import command

I try with local path syntax, URL syntax and Microsoft specific one, but none seems to be correct.

Upvotes: 0

Views: 811

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97292

OK, step=by-step

svnadmin create "D:/svn/test/"

OK, if you'll get ordinary FS-tree of repo in this dir (I saw, you got)

svn import . "D:/svn/test/"

FAIL. According to SVN Book, format if import is svn import [PATH] URL (note the last word: URL). I.e.:

  • if you have some data in . ("D:\TestPrj")
  • if you want to add it into repository, placed at D:/svn/test/ and not served by any SVN-capable server
  • you must to use file:/// protocol and full physical path in URL without quotes around URL

I can't recall and can't test, have you have backslashes or slashes in path, you have to try it (starting from backslashes, I suppose)

Remember that Subversion expects all repository paths in the form file:///C:/SVNRepository/. Note the use of forward slashes throughout

svn import . file:///D:/svn/test

But I'll recommend perform (before import) two additional steps in order to make life more easier

  1. Don't import into root, follow recommended repo-tree and create /trunk /branches /tags hierarchy in root (import into trunk can be performed without preliminary created trunk, because "Parent directories are created in the repository as necessary...")
  2. Run svnserve in easy and fast mode (listen on 127.0.0.1, root is root of your repo) and import into svn://localhost/trunk (or maybe slightly different path according to your choice) and don't solve problems of physical path, quotes, slashes

Upvotes: 1

Related Questions