Trouble with basic subversion operation

I'm new to IntelliJ IDEA and am loving it. However, I'm having a little trouble with subversion. I wrote a spring application. Most things in IDEA are very intuitive and I was amazed how it recognized issues with spring xml bean properties, JSTL code and other associated configuration files. Clearly IDEA is very impressive.

But subversion, something that should be very easy and core to every java developer (at least some form of version control), was not intuitive at all for me. And I still can't figure out how to use it. I imported my initial code. I had actually done that before on a ruby project in IDEA with the ruby plugin. That's easy enough. But on this project I updated it the next day and was unable to check in my updates. There is no option to check in the code. Only import, browse and checkout. So ok, I figure I need to checkout first before checking in. But checkout doesn't even work because right away I have directories that already exist and so the conflict causes the subversion function to quit. Same situation for import (but reversed). I thought, ok maybe I screwed up by modifying some of my code (actually only 1 out of about 100 files) before checking out, though that would be a sucky limitation. So I imported other code and I can't checkout that code either.

What do I do? How do I use subversion with IDEA? I need to be able to check in my code every day and would really rather not use an external subversion tool.

On the topic of the poor intuitiveness of subversion in IDEA, how do I exclude files from being imported/checked in to my subversion repository? I tried everything for this important and simple feature and read the documentation too. Please tell me this is possible in IDEA.

4 comments
Comment actions Permalink

Hello Scott,

Please ensure that the versioned roots are listed in Settings | Version Control
| Directory Version Control Settings.

I'm new to IntelliJ IDEA and am loving it. However, I'm having a
little trouble with subversion. I wrote a spring application. Most
things in IDEA are very intuitive and I was amazed how it recognized
issues with spring xml bean properties, JSTL code and other associated
configuration files. Clearly IDEA is very impressive.

But subversion, something that should be very easy and core to every
java developer (at least some form of version control), was not
intuitive at all for me. And I still can't figure out how to use it.
I imported my initial code. I had actually done that before on a ruby
project in IDEA with the ruby plugin. That's easy enough. But on
this project I updated it the next day and was unable to check in my
updates. There is no option to check in the code. Only import,
browse and checkout. So ok, I figure I need to checkout first before
checking in. But checkout doesn't even work because right away I have
directories that already exist and so the conflict causes the
subversion function to quit. Same situation for import (but
reversed). I thought, ok maybe I screwed up by modifying some of my
code (actually only 1 out of about 100 files) before checking out,
though that would be a sucky limitation. So I imported other code and
I can't checkout that code either.

What do I do? How do I use subversion with IDEA? I need to be able
to check in my code every day and would really rather not use an
external subversion tool.

On the topic of the poor intuitiveness of subversion in IDEA, how do I
exclude files from being imported/checked in to my subversion
repository? I tried everything for this important and simple feature
and read the documentation too. Please tell me this is possible in
IDEA.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thank you Dmitry, excellent quick support!! Ok, so yes that was the issue. Now I've added the module directory and I see all the subversion options in the menus. Plus I noticed the place to configure excluded files, though would be nicer to set that in the context menu.

Now why wasn't this done automatically for any of my projects? 3 of my projects don't have this setting and so even though I did an SVN initial import from within IDEA, none of my files are versioned. What's the standard procedure when writing new code? This should really be documented in the manual, doesn't everyone run into this problem?? Do I first create the directory in my SVN repository, then add these Directory Version Control Settings and finally do an initial import of my new code?

Ok so now I have some code unversioned and a repository with mostly the same code. What's the best way to get my files versioned and do a checkin?

0
Comment actions Permalink

I second this enhancement request. This isn't a huge deal, but it would make IntelliJ that much cleaner for newbies.

0
Comment actions Permalink

I can see why people would like the IDE to take care of the initial import but this is really a feature that should be requested from the version control people. CVS and now Subversion has no way to take a local copy of a source tree and convert it to a working copy without going through the import step, delete your copy, then checkout from version control.

Here are the are the steps I take when starting a new project (from the command line, and I use Subversion for my version control needs):

1) mkdir tags, branches, trunk
2) svn import repos_url/project name
3) remove all the directories I just made
4) svn co repos_url/project_name/trunk my_working_copy_directory
5) Create a new intelliJ project and point it at the working copy

If you already have source code that needs to be imported (e.g. you start hacking out some code then want to put it in version control). I create trunk, mv the src directory under trunk, then create tags, branches. Then import into subversion.

I think step 3 where you have to delete everything off your local machine is the step that makes people nervous:-)

I have never had IntelliJ not recognize that the working copy was Subversion. It has always correctly setup the project to use Subversion (based on the .svn directories I would assume).

I believe IntelliJ does offer a Share Directory option which behind the scenes takes the necessary steps to get your code into version control and gets you a working copy. However, I would guess it is just performing the above steps on your behalf.

0

Please sign in to leave a comment.