| Summary: | [RelEng] Better support to replace existing projects with a given branch | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dani Megert <daniel_megert> | ||||
| Component: | CVS | Assignee: | Michael Valenta <Michael.Valenta> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P5 | CC: | markus.kell.r, Szymon.Brandys, tomasz.zarna | ||||
| Version: | 3.1 | Keywords: | helpwanted | ||||
| Target Milestone: | 3.4 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | hasPatch | ||||||
| Attachments: |
|
||||||
|
Description
Dani Megert
> ==> some of the projects got empty because there was no branch
This is actually a bug. The user should not be able to check out an inexistent branch. The action should just leave projects that don't have the selected branch alone.
Created attachment 72778 [details] Fix I was too lazy to find all branched projects by hand, so I just fixed it in the source. The patch also fixes bug 125140. Thanks for the patch Markus. There is a fundamental problem with the patch. It assumes that the user chose to refresh the tags in the tag selection dialog. If the user does not refresh, it is possible that projects (or resources) that have the tag will be excluded from the operation. The only way I can see to make this work is to refresh the tags in the ReplaceOperation as well. I think that an acceptable workaround is to refresh in the replace operation if the tag is not found for a resource. I have added this to the patch and released it. I also added a short circuit which automatically adds the resource if the tag is a date, head or base tag. Thanks for the quick review/release. However, I just got the NPE below with the version in HEAD after deleting a file and the choosing 'Replace With > Latest from HEAD' on the parent folder. It looks like getTag() can return null. java.lang.NullPointerException at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.addResourceIfTagExists(ReplaceOperation.java:145) at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.getResourcesToUpdate(ReplaceOperation.java:131) at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.internalExecuteCommand(ReplaceOperation.java:86) at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.access$0(ReplaceOperation.java:84) at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation$1.run(ReplaceOperation.java:68) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797) at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.executeCommand(ReplaceOperation.java:65) at org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation.execute(SingleCommandOperation.java:42) at org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation.execute(RepositoryProviderOperation.java:280) at org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation.execute(SingleCommandOperation.java:66) at org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation.execute(RepositoryProviderOperation.java:256) at org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation.execute(RepositoryProviderOperation.java:210) at org.eclipse.team.internal.ccvs.ui.operations.CVSOperation.run(CVSOperation.java:81) at org.eclipse.team.internal.ui.actions.JobRunnableContext.run(JobRunnableContext.java:144) at org.eclipse.team.internal.ui.actions.JobRunnableContext$ResourceJob.runInWorkspace(JobRunnableContext.java:72) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) (In reply to comment #4) > I also added a short circuit > which automatically adds the resource if the tag is a date, head or base tag. Changing if (tag.getType() == CVSTag.DATE || tag.isHeadTag() || tag.isBaseTag()) in ReplaceOperation.addResourceIfTagExists(..) to if (tag == null || tag.getType() == CVSTag.DATE || tag.isHeadTag() || tag.isBaseTag()) fixes the problem. Bumping up the severity: I can no longer use Replace With > Latest From HEAD on my files as I always get an NPE. Sorry about that. Fix released to HEAD. Verified in I20070806-1800. "Replace With >" for multiple projects works as expected. |