Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-03 14:56:23 -0500
committerMichael Valenta2003-12-03 14:56:23 -0500
commit79e5b8894920be0f52945d22bbedb5c226162c86 (patch)
treee47f8ed37a01af9e4a03bec188ca722801b289bc
parent5c409f63fad13e45b8aaf6aad5725d9e3ff2b0e9 (diff)
downloadeclipse.platform.team-79e5b8894920be0f52945d22bbedb5c226162c86.tar.gz
eclipse.platform.team-79e5b8894920be0f52945d22bbedb5c226162c86.tar.xz
eclipse.platform.team-79e5b8894920be0f52945d22bbedb5c226162c86.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdateWithOverwrite.java64
1 files changed, 64 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdateWithOverwrite.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdateWithOverwrite.java
new file mode 100644
index 000000000..8d662ced1
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdateWithOverwrite.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.core.client;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
+
+/**
+ * A specialized update that will ignore unmanaged local content.
+ * It is the same os CheckoutWithOverwrite.
+ */
+public class UpdateWithOverwrite extends Update {
+
+ /**
+ * This class overrides the "Created" handler but uses the "Updated"
+ * behavior which will overwrite existing files.
+ */
+ public class CreatedResponseHandler extends UpdatedHandler {
+ public CreatedResponseHandler() {
+ super(UpdatedHandler.HANDLE_UPDATED);
+ }
+ public String getResponseID() {
+ return "Created"; //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.core.client.Command#doExecute(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption[], org.eclipse.team.internal.ccvs.core.client.Command.LocalOption[], java.lang.String[], org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus doExecute(
+ Session session,
+ GlobalOption[] globalOptions,
+ LocalOption[] localOptions,
+ String[] arguments,
+ ICommandOutputListener listener,
+ IProgressMonitor monitor)
+ throws CVSException {
+
+ ResponseHandler newCreated = new CreatedResponseHandler();
+ ResponseHandler oldCreated = session.getResponseHandler(newCreated.getResponseID());
+ session.registerResponseHandler(newCreated);
+ try {
+ return super.doExecute(
+ session,
+ globalOptions,
+ localOptions,
+ arguments,
+ listener,
+ monitor);
+ } finally {
+ session.registerResponseHandler(oldCreated);
+ }
+ }
+}

Back to the top