tags:

views:

1159

answers:

5

I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but that doesn't seem to give me what I want. Am I doing something wrong?

+3  A: 

There is an option when creating a new project, to use an existing source directory:

New project/ new Java Project / Create project from existing source.

Use that, tell it where your source lives, and it should automatically detect if it's a SVN working copy.

sleske
I am create a proj from an existing dir, but it's not detecting it as an svn working copy :/
allyourcode
Strange, just tried it, works for me. I also use Subclipse 1.4. Does Subclipse work at all? Try checking out a small project as a test. Also check if your working copy really is a proper SVN working copy.
sleske
Yes, subclipse works; I was able to check out some code using it.
allyourcode
I'm kind of thinking there's a version conflict between the client implemented by subclipse and Tortoise; I have a pretty recent version of Tortoise, so I'm guessing it's using version 1.5 or something.
allyourcode
That would be an explanation. Every WC directory has a folder .svn. .svn/format contains the version of the WC; check if it matches between your WC and one checked out using Subclipse.
sleske
I just wanted to drop a note to make sure you're using the correct version of Subclipse based on the installed version of Subversion. If you're already using TortoiseSVN, right-click on your repository folder > TortoiseSVN > About: Subversion {version number}If you have a particularly large repo, then Eclipse might spin for a while as it indexes the local files. If you get the message "the user operation is waiting for background . . . ", then just sit it out or force Eclipse to quit and restart it.
iKnowKungFoo
+1  A: 

Add the repository to your list of repositories in subclipse by choosing Window->Show View->Other... and choose SVN->SVN Repositories. Put in all the necessary info to connect to the repository.

Next, right click the repository and choose "checkout". If the project doesn't already have an eclipse .project file, you can create a new project from the source. If it already has a .project file, it will import that .project and use that as your eclipse project locally.

bkritzer
I want eclipse to use an _existing_ working copy. Your suggestions, which probably works, involves checking out another copy.
allyourcode
I've always found that if you don't create a project in eclipse by checking out a project in subclipse, it's very difficult to create a project from that code, which is why I suggested the whole "starting from scratch" idea.
bkritzer
+1  A: 

I guess this is not possible with Subclipse as it's given in its documentation that, you can only import an existing svn-managed folder under one condition, according to the doc:

"The only requirement is that your working copy has to also be a valid Eclipse project."

So, if you have a working copy that is not a complete eclipse project, Subclipse will not connect it to SVN.

sarav
Your avatar totally helped you get my up vote. This just leads to the question "What's a 'valid' Eclipse project?". I think I have one of those, because I have a .project file in the root of my working copy.
allyourcode
A: 

It will definitively not work if you use a different version of svn to checkout, that the one that is supported by Eclipse. I had this problem as I used svn 1.6 to checkout but I had an older eclipse version that had only 1.5. Subclipse has its own build-in svn client (Actually, in two flavors if I am not mistaken).

Check that the subclipse version matches the svn client that you used to checkout. You can check the plugin version number for subclipse (Help -> About -> Click on subversion logo) and match it against svn --version

Mario Ortegón
A: 

i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such.

i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its old name. not very nice, but it did the trick :-)

whoismanu