Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2005-03-16 14:08:41 +0000
committerMichael Valenta2005-03-16 14:08:41 +0000
commitcb5a47f056ac68d0325855085d99db23d1e32cda (patch)
treeb0c0ad1eaff5a79f081c610bf000102d175ef527 /bundles/org.eclipse.team.cvs.ui
parenta7ca01605e5bdb12abe21a13be564f5206629845 (diff)
downloadeclipse.platform.team-cb5a47f056ac68d0325855085d99db23d1e32cda.tar.gz
eclipse.platform.team-cb5a47f056ac68d0325855085d99db23d1e32cda.tar.xz
eclipse.platform.team-cb5a47f056ac68d0325855085d99db23d1e32cda.zip
Bug 40678 CVS Restore from Repo does not work if file deleted on branch
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
index 9a0c8fbd9..0978126c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RestoreFromRepositoryAction.java
@@ -65,21 +65,25 @@ public class RestoreFromRepositoryAction extends WorkspaceTraversalAction {
ICVSFolder commandRoot,
IProgressMonitor monitor) {
- // Find all RCS file names that contain "Attic"
- int index = line.indexOf(ATTIC);
- if (index == -1) return OK;
// Extract the file name and path from the RCS path
// String filePath = line.substring(index);
- int start = line.indexOf(Session.SERVER_SEPARATOR, index);
- String fileName = line.substring(start + 1);
- if (fileName.endsWith(RCS_FILE_POSTFIX)) {
- fileName = fileName.substring(0, fileName.length() - RCS_FILE_POSTFIX.length());
- }
- try {
- atticFiles.add(currentFolder.getFile(fileName));
- } catch (CVSException e) {
- return e.getStatus();
- }
+ // Find all RCS file names that contain "Attic"
+ int start = line.lastIndexOf(Session.SERVER_SEPARATOR);
+ if (start != -1) {
+ String fileName = line.substring(start + 1);
+ if (fileName.endsWith(RCS_FILE_POSTFIX)) {
+ fileName = fileName.substring(0, fileName.length() - RCS_FILE_POSTFIX.length());
+ }
+ if (currentFolder != null) {
+ try {
+ ICVSFile file = currentFolder.getFile(fileName);
+ if (!file.exists())
+ atticFiles.add(file);
+ } catch (CVSException e) {
+ return e.getStatus();
+ }
+ }
+ }
return OK;
}

Back to the top