Bug 301499 - "Checkout As" Wizard is not waiting for new project to be created
Summary: "Checkout As" Wizard is not waiting for new project to be created
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-02 03:45 EST by Jacek Pospychala CLA
Modified: 2019-09-06 16:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2010-02-02 03:45:48 EST
Hi Team!

Our users hit a problem when using "Import from CVS" project wizard. Their steps are like this:
1. Choose "File -> Import", then "Import from CVS"
2. Choose a folder which is not Eclipse project (without .project file, etc.)
3. Keep all defaults and press Finish
4. Notice that "New Project" wizard is started to create some project
5. Our users have template project structure in CVS, so in the "New Project" wizard, they again choose "Import from CVS"
6. This time pick the real Eclipse project in CVS and press Finish
7. Note that the valid project is checked out correctly, but the original "Import from CVS" wizard has not finished.

User would expect that, the original "Import from CVS" wizard picks the project newly imported in steps 5-6 and safely finish checking out.

Instead, the project imported in steps 5-6 is checked out correctly, but project that we wanted to check in steps 1-3 is still waiting for new project to be created.
Comment 1 Jacek Pospychala CLA 2010-02-02 03:52:16 EST
ok, I've been digging a little into this problem and IMHO the cause is in
org.eclipse.team.internal.ccvs.ui.wizards.CheckoutAsWizard#getNewProject()

That method is responsible for launching a "New Project" wizard for our imported folder and fetching it's result. It calls 

new NewProjectAction(window).run()

but it wait's only for NewProjectAction wizard dialog to be closed, and not for the project to be created.

This works most of the time, assuming that new project wizard finishes it's job before closing the wizard dialog. However it doesn't work for new project wizards, which spin-off separate long-running job/thread to create a project.
Comment 2 Jacek Pospychala CLA 2010-02-02 03:57:05 EST
A possible solution could look like this:

NewProjectListener listener = new NewProjectListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
(new NewProjectAction(workbenchWindow).run();
IProject project = null;
+  while (project = listener.getNewProject()) { 
+   waitWhileNewProjectIsBeingCreated();
+  }                                            
ResourcesPlugin.getWorkspace().removeResourceChangeListener(listener);
return project;
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:14:46 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.