How do you make eclipse use an existing svn working copy? - eclipse

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?

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 :-)

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.

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.

You can right click on the root node of your project and select: Team / Share project
Then you choose SVN, let the default settings and it should work fine!

I am answering this after a long time of the question being asked. I ended up here because I was facing the same problem.
My solution was to create an empty .svn folder at the root folder of the project (in the latest version of svn client tortoise all meta-data is at the root folder). Then did an eclipse refresh and voila it did the trick. I am running subclipse core - 1.8.4.

One step that seemed to work for me, that no one has explicitly mentioned yet: I closed and then re-opened the project. I tried the "rename" trick, above, and that didn't work, but perhaps the poster of that answer also closed the project - they didn't detail exactly what steps they went thru to rename it. (I found you don't have to close the project to rename it, but perhaps they did.)
< /rob>

In my case, I couldn't use an existing copy because I checked out the code using a newer version of Subversion on the command-line and Subclipse 1.4 couldn't recognize it. Upgrading and going through the improved "Share Project" menu resolved the problem.
I got this tip from the forums here:
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064

I had the same issue and here are the details of the fix.
My Eclipse is "Helios Service Release 1".
I had an SVN checkout on my filesystem, I went to New Java Project, unchecked Use default location, chose the location, went to next step, chose the source folder and said Finish.
The project came up with no disk icon on it. As per few forum posts, right-clicked on the project, went to Team > Share Project, chose SVN, clicked Next, and the option was only to share the files to the SVN Repository for the first time.
I said Cancel, and the option is to make changes to the SVN plug-in settings. Went to Window menu, chose Preferences, browsed Team> SVN. Chose the SVN Connector tab, changed the SVNKit 1.2.3 to SVNKit 1.3.5 and said OK.
Then, right clicked on the project, said Team> SVN, on the next screen, chose the option Use Project Settings and clicked Finish. The disk button came to the project and the SVN URL got displayed on it.

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.

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

This worked for me:
1) Go to the 'SVN Repository Exploring' perspective and add a folder somewhere above your working copy
2) Close and open the Eclipse projects.
This should then be enough to get them recognized by Subclipse.

I have encountered a similar situation were existing projects would not get associated with the Subversive plugin. Unfortunately, none of the previous suggestions helped (renaming projects etc.). What has helped is removing projects from Eclipse by deleting them -- just the projects from Package Explorer and not the actual directories and files on disc (the deletion prompt has a special checkbox for that, which is unchecked by default) -- and reimporting the deleted projects as existing projects back.
Of course, as mentioned in some of the answers here, the relevant SVN repositories need to be registered with Eclipse before reimporting the projects. Otherwise, there would no repositories to re-associate the projects with.

When you open a versioned project (i.e., a project in SVN working copy) in Eclipse, that was never previously used with Subclipse, you need to perform these steps:
Right-click the project in Project Explorer.
Select Team | Share Project.
At this point Subclipse will tell you that "The project is already configured with SVN repository information". Click Next.
Subclipse automatically recognizes this project as versioned and all the features of the SVN plug-in should become available.

Related

Eclipse: The SVN synchronization information for 'Project' has become corrupt or does not exist

For some days now Ecplise (Oxygen 4.7.1a) shows me question marker icons at all folders and files in the project explorer.
I figured out that this is caused by a broken SVN synchronization. Eclipse error log shows The SVN synchronization information for 'Project' has become corrupt or does not exist.
I use Subclipse (latest version) from Eclipse market place.
I tried:
removing and reinstalling Subclipse
removing workspace and check out SVN repo again
Still the same problem.
The curious thing is that SVN connection is ok. I can use Tortoise SVN in Windows explorer and SVN command line, but Subclipse in Eclipse does not work.
Any solutions to this?
I had the same. I tried the one thing in the link recommended by howlger, namely:
"Close Eclipse. Open your workspace folder and then navigate to:
.metadata\.plugins\org.eclipse.core.resources\.projects
There will be a folder for each project, each will have a file named .syncinfo
in it. Delete all of these files and restart Eclipse."
It did not help. But then I tried "Add to Version Control". It complained that the project is already under Version Control, but the question mark is gone and everything seems to work OK now.

SVN Switch with relocate in Eclipse

My question can be claimed to be an extension/similar to the question posted here.
basically, I need to do the same functionality using Eclipse plugin Subclipse. Subclipse has a functionality to "Switch branch/tag/revision", however, this is limited as it treats the new url as a repository and tries to compare them. I only wish to change the URL.
any ideas!
From SVN Repository Exploring perspective right click on your project repository and choose Relocate.. from contextual menu:
It will bring up a confirmation windows showing you active projects which will be affected by relocation.
In more recent versions of Eclipse/Subversive (which don't have the Relocate option) you can simply click Location Properties instead and change the URL. It will warn you that "The attached projects will be relocated because the repository root URL differs from the previously entered one." This is what you want!
I had the similar issue on Eclipse Luna 4.4.2 64 bit version. Initially I've relocated the project on the command line and Eclipse failed to recognize the relocation change. Alternatively I've tried to delete and re-import the projects, but sadly this approach failed to work out as well. Then sorted it out this way;
Closed all the projects,
Opened the SVN Repository Exploring perspective,
Right clicked on the repository >> Location properties,
In the properties pane, I've changed the url and in the below I choose "Use the repository URL as the label" clicked on finish,
Switched back to the Java perspective and reopened the projects.
After this alteration Eclipse stopped giving such errors and I was able to see the new root address of each project on the right side of the name
I found that if the projects that are related with the SVN you are trying to relocate are open in Eclipse, the operation fails with the following error in the 'SVN Console':
switch --relocate http://old.scm.com/svn/APP http://new.scm.com/svn/APP .../webapp
svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy
svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy
The solution was to close all the projects (Project Explorer -> right click on the project -> Close Project) and only after that, do the URL relocation in the SVN window (SVN Repositories window -> right click on the URL of the old SVN -> Relocate).
Notice that that the box 'Projects that will be relocated:' on the following screen is empty. Before it showed all the open projects in Eclipse IDE.
This was they only way I got it to succeed.
Using Eclipse Kepler Service Release 2, with Subclipse 1.10.10.

Reconnect Eclipse Project to SVN with Subclipse

I've been using Subclipse to manage SVN projects in Eclipse 3.4.2. However, while installing a buggy plugin, Eclipse became so sluggishly unusable that I had to kill the process and restart. Unfortunately, even though I removed the buggy plugin, this appears to have destroyed Subclipse's links to all my SVN projects. The projects themselves are still there, but the "Team" context menu only shows "Apply Patch", and no SVN icon overlays are being displayed. Is there anyway to fix this, or do I have to delete and recreate all my projects?
If your project has the .svn directories (only the Eclipse integration 'has gone missing') you could try Team -> Share Project. In my workspace, Subclipse noticed the presence of the SVN folders and created the appropriate connection.
Edit: if you do not have the Share Project menu maybe the Eclipse installation 'got screwed'. If you do not have the Share Project menu in a newly created project and you do not see the SVN preferences under Preferences --> Team then you should re-install the Subclipse plugin.
If you do not have the Share Project menu only the projects you previously shared with SVN, than you should delete and recreate all your projects (in the delete do not delete the project contents and after the delete select File -> Import -> Existing projects into Workspace).
I also had the same problem and there is a simple fix:
Just rename your project ( right click on the project - Refactor - Rename) and it will re-link your project with svn. (Then you can rename it back).
For me the only thing that worked was:
Copy the entire project.
Eclipse ask to synchronize.
Delete old project.
Rename copied project.

pydev and the src directory vs. scm

I'm trying to transition to eclipse+pydev but am having a problem importing projects under scm. My old projects (and also projects on github) don't have the "src" parent directory that pydev seems to really like.
If I use egit or subclipse to import/check out the project, the pydev environment is incomplete. If I externally check out the source and move it into place, I don't seem to be able to tell eclipse it's SCM'd.
I would think this is a FAQ, but I can't figure it out. What is the best practice to use SCM'd projects under eclipse that aren't SCM'd as eclipse projects.
Thanks. Kent
Choose the properties for the project. Then change the pydev-PYTHONPATH - remove the src entry and then add the directory of your project that contains the source.

Subclipse complains "Path is not a working copy" after moving workspace

I recently moved my Eclipse workspace directory and now Subclipse complains every time I open a file, dumping to the console something like:
Path is not a working copy directory
svn: '[original (pre-move) directory path]' is not a working copy
No such file or directory
This also happens when I explicitly try to view the history of a file. This persists across SVN cleanups, closing and re-opening Eclipse, etc.
Update, checkin, checkout and so on all seem to work fine, and Tortoise doesn't complain at all, so clearly it's not the SVN metadata that's screwed up, it's some Subclipse-specific metadata. Can anyone tell me how to blow this broken metadata away?
Edited to add: "Team > Disconnect" followed by "Team > Share" doesn't solve the problem.
Edited again to add: I've grepped through the whole .metadata directory and one of the project directories for a unique element of the old path and can't find it anywhere except in .metadata/.log (the error message itself) and some old Findbugs warnings. Very nice.
You need to delete the .syncinfo files. This is easily done (in most cases) by closing and opening Eclipse, however you can also do so manually as in the following:
To delete the cache, close Eclipse. The cache is stored in:
[workspace]/.metadat​a/.plugins/org.eclip​se.core.resources/.p​rojects/PROJECTNAME/​.syncinfo
So you can just find and delete all files named .syncinfo in
[workspace]/.metadat​a/.plugins/org.eclip​se.core.resources/.p​rojects
Quoted from this article: http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=868799
I just did a "Team -> Cleanup" and this exact error went away! I also got this error because I moved between machines and the path wasn't the same.
Using Eclipse 3.6 and the Subversion 1.6 plugin.
Update in 2016: Still works perfectly with Eclipse 4.5.2 and Subclipse 1.10.
Edited to add: Nope, spoke too soon. This doesn't fix it. Some files just seem not to exhibit the problem.
The following seems to solve the problem:
Team > Disconnect.
Quit Eclipse.
Blow away .metadata/.plugins/org.tigris.subversion.subclipse.*.
Restart Eclipse.
Team > Share.
Not sure how the old path was actually being stored in the plugin prefs, but it must have been in there somehwere. It's kind of pathetic of Subclipse to store absolute paths, but apparently it is.
There's a bug filed on this, or at least on the same error message. No context. Fifty cents says it gets rejected.
I'm sure there are many causes with different solutions, but I found the one that worked for me at Dan Wilson's blog. Simply remove the offending folders from the workspace (probably saving them if they have new content), update (letting Subversion recreate the folders), then move the contents back into the fresh folders in your workspace.
I got the error when I tried to rename a class by changing the case from DAO to Dao in Eclipse.
I had to rename it to something like Dao2 and then was able to rename it to Dao.
What worked for me:
Do a "refactor - rename" on the project => after that do it again to rename it back to the original name.
I was having the same error message using subclipse with javahl on a project that is out of the workspace directory. Changing to svnKit has resolved my problem.
Hard to say without further information.
Did you move the whole workspace or just the content?
Also, you can try creating new workspace from scratch and check out the whole project again.
Alternatively, you may try deleting the .metadata directory and relink the project again using File -> import -> existing project into workspace and then relink the SVN data through Team -> Share projects (with an 's'), or maybe just do this last bit after first disconnecting the project from SVN.
Right click the project folder : Team -> Update to Head
This will bring back the directory. Delete it again and Commit
In my case I had the folders of the projects in the Project Explorer and just had to reopen the project
For me, this error message was caused by an out-of-date installation of Subclipse, and the underlying SVNKit and JahaHL libraries. I have been using TortoiseSVN outside of Eclipse to manage my project directories, and my recent upgrade to the 1.8.x series of (Tortoise)SVN tools broke my working copies for Subclipse.
All I had to do to fix, was go to Help->"Install New Software..." and click "Add..." to add a new update site. I picked the latest update site for the latest release on http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA and upgraded Subclipse from there.
Then all my existing projects just worked, and I could reconnect to the one I had already tried disconnecting from without problems.
I have the same problem
I had a new project, added it to SVN. Then everything works as normal, until I try and refactor-rename any java file, I get:
move D:/dev/sk_ws/ge-parent/ge-core/src/main/java/com/skillkash/ge/beans/Skbean.java D:/dev/sk_ws/ge-parent/ge-core/src/main/java/com/skillkash/ge/beans/SkBean.java
Path is not a working copy directory
svn: Path 'D:\dev\sk_ws\ge-parent\ge-core\src\main\java\com\skillkash\ge\beans\SkBean.java' is not a directory
Now the SVN URL is:
svn://qnap/share/MD0_DATA/svn/sk/ge-core/trunk
and the repository root is:
svn://qnap/share/MD0_DATA/svn/sk
Obviously just sharing the project then trying to move a file using subclipe does not work - it must be a bug. I have to do all my refactoring outside eclipse, and hand edit all the files which are affected.
checkout the whole project to a temp dir, then I copied the first level .svn directory and replaced my working copy .svn folder with this.
http://blog.itopia.de/directory-svn-containing-working-copy-admin-area-is-missing/275
It woks for me.
I had added a png file to my project, but I got this error trying to rename or delete it. Cleaning and refreshing the project didn't do anything.
I went into the svn Team Synchronizing perspective, right clicked on the file and deleted it. That solved my problem.
Right click on the project and select Teams -> Switch to another Branch/Tag/Revision.
Select the appropriate Branch/Tag/Revision that the project should be tied to and click OK.
Give Eclipse some time to process the changes.
Restart Eclipse for the changes to take affect.
I just got this error when I was trying to update some .java files. The problem was I was trying to update the files but the folder that contains that files didn't exist in the path so when I sync and update the folder it works at the first try.
So, dont try to sync files, try to sync the folder.
Sometime ago I had a similar issue. Seems that Subclipse (or Eclipse) stores the absolute path of your working copies. The cleanest solution is to export again your repository to the new path.
If you have non-committed code, then you can copy it on top of the clean export (without the .svn folder)
I too had this issue and I simply deleted the project from the workspace (leaving the files on the files system in tact).
I then imported an svn project into the workspace.
Import->SVN->Checkout Project From SVN.
I used my existing repository location to pull the files in.
This issue was caused when I changed Eclipse editions and used a Subclipse plug-in that was a version ahead of what I should have used.
I uninstalled the newer version and installed the correct older version and all worked well.