Add existing IDEA project to new Subversion repository

I've been working on a project for a while and decided I wanted to move it to a Subversion repository to help the tracking of changes and integration into a bug tracker and eventually TeamCity.

My Subversion installation is running on openSUSE 11.4 with SVN version 1.6.15 (latest version, but a patch or two behind) and using svnserve to serve commands and I created a repository named "LicenseManager" (the same name as my project).

My repository URL is along the lines of svn://svn.example.org/LicenseManager

I created parent directories like so:

# svn mkdir --parents svn://svn.example.org/LicenseManager/trunk svn://svn.example.org/LicenseManager/tags svn://svn.example.org/LicenseManager/branches

I can see those directories like so:

# svn list svn://svn.example.org/LicenseManager
branches
tags
trunk

I have configured IDEA to connect to my repository at svn://svn.example.org/LicenseManager and I can browse it and see the parent directories I created. However, here's where my problems start:

I can "import" my project into the trunk directory, but doing so does no good, as IntelliJ does not recognize it as its project. I can't compare changes I made to a file or anything ... all of those changes are greyed out.

For a while, at first, IntelliJ thought some (not all) of the files I imported into Subversion were part of the project and allowed me to click things like "Commit" or "Compare with latest version," only to then give me the error "Error: svn: '/Users/Nicholas/....../LicenseManager/trunk/web/WEB-INF/jspf' is not a working copy." After this error, the "Commit," "Compare..." and related options were unavailable. Only "Add."

I cannot add any files to the repository. The "Add" option isn't greyed out, but when I click on it, I get the error "Error: svn: No versioned parent directories."

If I try to integrate the project into the repository, I get "SVN: Update Error" pop-up dialog with error "No versioned directories to update was found." (The grammar error was not mine.)

I'll admit I'm new to subversion, and I haven't been using it long, but I would have thought it would have been easier than this to add an IDEA project into Subversion, and the documentation only covers (well) opening a project from a repository. It offers very little help getting my existing project into a repository, and certainly doesn't address any of these errors.

Help?

Thanks!

3 comments
Comment actions Permalink

I figured this out. For the benefit of other struggling users, I will post my discovery. However, first I would like to express my frustration with SVN integration. Everything else works so well in IntelliJ, and I have gotten used to (maybe spoiled by) that. But the SVN integration was written with the following bad assumptions:

1. That your project always already exists in Subversion, added by somebody other than you, and that you should never need to actually add an existing IntelliJ project into a new repository
2. That when you check a project out from Subversion, it is never an IntelliJ project, but instead just a structure of code that you probably want to create an IDEA project from

Here are the steps I had to take to get this to work (after setting up my repository and creating my parent directories, including "trunk"):

1. Open my IntelliJ IDEA project
2. Enable Subversion integration
3. Import the root directory of the project into the trunk directory in Subversion
4. Close the project
5. Click "Check out from Source Control" on the welcome screen, and select "Subversion."
6. Open the repository and select the truck directory, then click "Checkout"
7. Select your local project directory, which will be written over
8. Wait for IDEA to check out all of the files you already have and overwrite them
9. When asked if you want to create a new project from the existing sources checked out from Subversion, click "No"
10. Click "Open Project" (not "Open Recent Project") from the welcom screen or menu and browse to your project to open it

You will now be able to use Subversion with your existing project. If anyone here thinks this is a convenient or user-friendly process, by all means, please explain where I am going wrong.

I will add an enhancement request to YouTrack. Hopefully soon it will be much easier to use.

Nick

1
Comment actions Permalink

Its five years latter and the SVN integration is still an issue.  Ive been developing using svn for 15 years.  The SVN Integration is such and issue I am considering going back to eclipse. 

2
Comment actions Permalink

Same experience here. IntelliJ does not update a project as svn project after importing into svn. You have to do some hacks like reopening er checking the project out again.

0

Please sign in to leave a comment.