Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 173994 - [Import/Export] Importing project with the same nazme as other project that is already in the workspace
Summary: [Import/Export] Importing project with the same nazme as other project that i...
Status: RESOLVED DUPLICATE of bug 163601
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P5 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 157885 195544 197781 198160 199368 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-13 07:33 EST by Jakub Jurkiewicz CLA
Modified: 2008-03-11 09:27 EDT (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jurkiewicz CLA 2007-02-13 07:33:51 EST
Step to reproduce:
1. Create a simple project
2. Create some file in the project (let's name it "a.txt"_ and fill it with some content (e.g. "aaa")
3. Delete this project from eclipse, but without deleting the content
4. In the file system copy the directory with the project to some other location.
5. In the copied version of the project change the content of the file a.txt (change it to "bbb")
6. Add additional file to the project (e.g. "z.txt")
7. Run the Import Existing Projects into Workspace wizard.
8. Choose the directory, where you copied the project
9. Choose the copied project from the list and select the checkbox "Copy projects into workspace"

Additional information:
What happens? The wizard exits with no error. In the package explorer we can see the imported project with two files: 
- file "a.txt" with content "aaa" 
- file "z.txt"
So, the file that already was in the project (which already was in the workspace) didn't change. But, the second file was added. Now we have a mix of two projects. 
From the debugging I found out that in the method org.eclipse.ui.wizards.datatransfer.ImportOperation#importFile when importing file (int his case "a.txt") there is a ResourceException caught witsh status: "A resource already exists on disk". This status is later added to the List of errors but later on this list is not used.
I think, that there should be a dialog that would warn the user that the project with specific name already exists in the workspace and forbid him to import the project. The best solution would be to let the user to rename the project, which is being imported, but there is already bug about this issue: 40493.
Comment 1 Jakub Jurkiewicz CLA 2007-06-20 03:15:37 EDT
Tod, I saw that you marked this bug as helpwanted. How do we want to resolve this?
Comment 2 Tod Creasey CLA 2007-06-20 10:25:55 EDT
I think the warning would be suffecient. if we try and get too smart about it we will likely just frustrate someone who knows what they are doing.
Comment 3 Tod Creasey CLA 2007-06-22 15:26:14 EDT
*** Bug 157885 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Jurkiewicz CLA 2007-06-25 07:21:21 EDT
As I have been investigating this already I can try to prepare a patch in the near future.
Comment 5 Jakub Jurkiewicz CLA 2007-06-26 03:27:53 EDT
I think about checking if the project being imported is already in the workspace folder. If it is, then the dialog should be displayed with the message (e.g. "Folder with the same already exists in the destination location" or something similar) and the user should have an option to overwrite or to cancel. Is it good direction?
Comment 6 Tod Creasey CLA 2007-06-26 08:53:52 EDT
Perhaps we should show them as two lists in the import dialog or show the exisiting ones differently. Two dialogs would make it hard for the user to play around with the configuration they want.

We will also need to consider deleting the old project when we import the new one.
Comment 7 Jakub Jurkiewicz CLA 2007-06-27 06:07:33 EDT
(In reply to comment #6)
> Perhaps we should show them as two lists in the import dialog or show the
> exisiting ones differently. 
I proposed a patch for Bug #163601 and the solution was to gray out the already existing projects and to allow to overwrite them. What do you think Tod about that patch?

Comment 8 Tod Creasey CLA 2007-07-09 08:01:10 EDT
*** Bug 195544 has been marked as a duplicate of this bug. ***
Comment 9 Tod Creasey CLA 2007-07-25 10:03:43 EDT
*** Bug 197781 has been marked as a duplicate of this bug. ***
Comment 10 Tod Creasey CLA 2007-07-30 11:10:05 EDT
*** Bug 198160 has been marked as a duplicate of this bug. ***
Comment 11 Tod Creasey CLA 2007-08-15 11:32:37 EDT
*** Bug 199368 has been marked as a duplicate of this bug. ***
Comment 12 Antoine Toulmé CLA 2007-09-20 10:10:26 EDT
Hi,

I don't agree with the priority of this bug.

In my work environment, we have a lot of little projects. Our QA teams tests more than 200 projects a day, and then share them as they find defects.

This bug is really limiting the Eclipse user experience.

Is it possible to raise the priority of this bug ? Can we have a target milestone for it ?
Comment 13 Tod Creasey CLA 2007-09-20 11:09:34 EDT
This is not in the plan for 3.4 but we would be happy to look at a community patch.
Comment 14 Remy Suen CLA 2007-09-20 11:13:27 EDT
(In reply to comment #13)
> This is not in the plan for 3.4 but we would be happy to look at a community
> patch.

Tod, what do you think about patch noted in comment 7?
Comment 15 Del Myers CLA 2007-09-20 12:20:25 EDT
Just adding my two cents:

The process of importing an existing project into the workspace is very similar to checking-out from CVS. The current process followed by CVS is that, if you choose to check it out as the same name as one that exists in the file system, but has been deleted from the workspace, the existing project is just deleted. There is no option for matching existing files.

Should the same sort of process be followed here (except with a possible "change project name" option)? Just to keep consistency.
Comment 16 Antoine Toulmé CLA 2007-09-20 13:10:53 EDT
There is a sensible difference (if I remember right) in the fact that you can import more than one project at a time, so you have a list of projects available, while you can only import one project at a time in CVS.

To have the possibility to change the name of the project would be great.

At a minimum seeing the projects that cannot be imported as disabled in the list would be good already.

I will try the patch on my machine soon. Thanks for contributing it.
Comment 17 Del Myers CLA 2007-09-20 13:30:47 EDT
I don't understand: I can check-out more than one project at a time in my version of Eclipse.
Comment 18 Antoine Toulmé CLA 2007-09-20 13:32:54 EDT
My bad then.
Comment 19 Antoine Toulmé CLA 2008-03-08 03:06:00 EST
Tod, can you please mark this bug as a duplicate for https://bugs.eclipse.org/bugs/show_bug.cgi?id=163601 ? 
Comment 20 Tod Creasey CLA 2008-03-11 09:27:06 EDT

*** This bug has been marked as a duplicate of bug 163601 ***