| Summary: | [Import/Export] Import existing project wizard doesn't allow to import a project from the workspace | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Panagiotis Korros <panagiotis.korros> |
| Component: | UI | Assignee: | Karice McIntyre <Karice_McIntyre> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P4 | CC: | java97301, matt.doran, ms, nikolaymetchev, osullivanro, sennsafe-devsites |
| Version: | 3.0 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Panagiotis Korros
I believe this would require the Project Import Wizard to know whether or not the user-entered location is the same as the default location. You can also just do this by creating new project and pointing to its location in the location field. As I said in my initial comment, creating a project is not allways a solution. If the workspace is located at c:\Projects and you want to import the c:\Projects\test project with a different name then you can't do it at all. The creation wizard informs you that you can't create a project into the workspace area (the message is 'Project contents cannot be in the workspace directory'). I think that the severity of this issue is MAJOR and should be given higher priority than P5. A new/inexperienced eclipse user will NEVER think of creating a new project. The first time it happened to me, I didn't know hot to solve this problem and creating a new project never came in my mind. I don't think that any eclipse user will think of creating a new project instead because 'project creation' doesn't have the same semantics with an 'import project' operation. Upping priority as requested. The reason it is currently implemented this way is that you are not importing really , your are restoring. Of course new is does not mean restore either so I don't think that is necessarily a reason to disallow it. If you have a suggested patch please apply it to the bug. I think I found was is causing the problem and why this problem appears in some projects only. My project workspace is c:\Projects, the project I want to import is located at c:\Projects\test but the .project file contains a different name for the project. The call to getWorkspace().loadProjectDescription(path) in WizardExternalProjectImportPage.setProjectName returns a descriptor with name: org.tigris.subversion.subclipse.test location: c:\Projects\test and the project creation fails because c:\Projects\test is not the default location but overllaps with the workspace. If I change the name in the .project file, everything works correctly but this isn't a workaround. Is there a way to load the project from the fefault location but use a different name? I just encountered exactly the same issue and came to the same conclusion (after a couple of painful hours investigation), and was about to raise the issue. If you try to import a project that's in the workspace, the "name" in the .project file must match the directory name exactly. If it differs then you get the unhelpful error message "invalid project description" and detailed message about overlapping that doesn't make much sense. In the very least the error message should be clearer. But given that you can rename the project to anything once imported, then there isn't any reason why importing like this shouldn't work. The project name has to match the name of the folder it is created in if it is under the workbench directory - this is a restriction of Core. Just like Matt Doran, I encountered exactly the same issue and it took me some hours to figure out what the problem was. Here was my use case: Some time ago, I had created a number of projects outside the workspace directory. Some projects had the same name as the directory they resided in, some not. Some had in the beginning, but renaming a project outside of the workspace directory only changes its name, not the directory it lives in. Switching to Eclipse 3.1M3 I wanted to clean up my project structures, so I started of with a fresh workspace and moved - outside of eclipse, literally the files - the project directories into the workspace directory. Within Eclipse I imported the projects one after the other. For some time I couldn't figure out, why some imports failed with the strange message "Invalid project description" (Details: "$projectDir and $workspaceDir overlap."). I looked at the .project files and everything looked OK. After some poking around I finally found bug 39343, where someone describes the same problem using CDT, and this bug report. With the tiny, additional information that I just have to rename the directory, everything went fine. So, please, for users at least make the wizard detect the special situation and give a more meaningful error message. Of course it would be even better, if the wizard would offer to solve the problem for the user ("Should I ( ) rename the project, or ( ) rename the directory?"). Best would be if eclipse could simply handle the case of projects which have their files in an directory in the workspace directory where project name and directory name differ. But if this is an restriction of Core, which will not change soon: OK, just use on of the little bit inferior solutions from above. Thanks *** Bug 90695 has been marked as a duplicate of this bug. *** Another case where this comes up -- if you create a new workspace where a set of projects already exist (for example: moving some sandbox projects under a new "sandbox" workspace to make way for real work). Since the workspace is not so much a physical location as a user Profile, this bug leads to confusion for a new user (not to mention the name "workspace" is misleading). The original comment on this bug was almost two years ago... Today, I spent a couple of hours riddling this out before I found this report. When is it going to be fixed? I'm using Version: 3.1.2 Build id: M20060118-1600 There is no way that the error message will lead anyone to discover that the name of the directory has to match the <name> element in the .project file. Even after learning this, I had to scratch my head a few times before I realized that I had misspelled the directory name BlahEndoder instead of BlahEncoder in the first place :) The error message should state something more meaningful, maybe somehting to the effect: "Project name does not match project folder name" The fix for bug 143757 (which was just released into the 3.3 code stream) allows you to import a project whose folder does not match the project name in the .project file. *** This bug has been marked as a duplicate of 143757 *** |