Question

My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of the trunk. Then I can start working.

However, when dealing with a large import, think hundreds of megs, and off-site version control hosting (http based) this initial import can take quite a while to commit. What's worse, after committing I need to checkout this massive trunk all over again.

Is there a way with subversion to use the local copy of the trunk without doing a checkout all over again of data that is already there?

Was it helpful?

Solution

There is - it's called an "in-place import", and it's covered in the Subversion FAQ here:

http://subversion.tigris.org/faq.html#in-place-import

What you're really doing is creating a new empty project in the repository, checking out the empty project your local folder - which turns your folder into a working copy - and then adding all your (existing) files to that 'empty' project, so they're added to the repository when you do an svn commit.

OTHER TIPS

I agree on the "in-place import" procedure and also using a script for TTB-structure(upvoted both).

Just a small hint:

You should not import a huge (ten of thousands) number of files in a single commit, if you use http(s), as the time for displaying the version history scales by the number of added entries. The reason for this behaviour is that apache has to authenticate all added paths agains the svnaccess file(of course, only if you enabled path-based authorization). This can render your repository unusable, as all files will have to wait on a svn log for this big rev.

You should divide huge imports on directory levels

I usually use "svn mkdir" to create the trunk/tags/branches directly on the server immediately after creating the repository. Then I can check out the empty trunk, move my initial files into that directory, add and commit them, and start working.

svn checkout --force lets you checkout a workingcopy 'over' an existing path. It keeps your old files and adds files that are only in your repository.

For creating your repository: You can perform multiple mkdir commands to a repository in a single commit using the 'svnmucc' command that is available in most Subversion distributions (e.g. SlikSVN).

Type svnmucc without arguments for some help.

If you've checked out a single folder, copied your files into it, run svn add and svn commit; you shouldn't need to delete the files and re-checkout.

Use the files in place: once they've been committed as you describe, they're ready to be worked on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top