Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-24 20:20:35 +0000
committerMichael Valenta2004-09-24 20:20:35 +0000
commitfb336dcc529bcba0a08322a885b265649bef7f93 (patch)
treed4f6d1aea26f07e2c38720b73ca094ffda867594
parente9a53952683de3d21af0fee3a8a9f639a3bab9e8 (diff)
downloadeclipse.platform.team-fb336dcc529bcba0a08322a885b265649bef7f93.tar.gz
eclipse.platform.team-fb336dcc529bcba0a08322a885b265649bef7f93.tar.xz
eclipse.platform.team-fb336dcc529bcba0a08322a885b265649bef7f93.zip
Starting to generalize change sets
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/ChangeSet.java236
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/IChangeSetChangeListener.java57
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/SubscriberChangeSetManager.java594
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberResourceCollector.java250
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberSyncInfoCollector.java169
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java94
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSet.java297
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetManager.java443
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ICommitSetChangeListener.java50
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java13
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch39
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch9
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java52
18 files changed, 1296 insertions, 1056 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/ChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/ChangeSet.java
new file mode 100644
index 000000000..d6c4d01b8
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/ChangeSet.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.core.change;
+
+import java.util.*;
+
+import org.eclipse.core.resources.*;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.core.TeamPlugin;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * A change set is used to group a set of changes together
+ * for some purpose, whether it be to display them together in
+ * the UI or check them into a repository as one checkin.
+ */
+public class ChangeSet {
+
+ private static final String CTX_TITLE = "title"; //$NON-NLS-1$
+ private static final String CTX_COMMENT = "comment"; //$NON-NLS-1$
+ private static final String CTX_RESOURCES = "resources"; //$NON-NLS-1$
+
+ Set resources = new HashSet();
+ private String title;
+ private String comment;
+ private final SubscriberChangeSetManager manager;
+
+ /**
+ * Create a change set with the given title
+ * @param manager the manager that owns this set
+ * @param title the title of the set
+ */
+ public ChangeSet(SubscriberChangeSetManager manager, String title) {
+ this.manager = manager;
+ this.title = title;
+ }
+
+ /**
+ * Get the title of the change set. The title is used
+ * as the comment when the set is checking in if no comment
+ * has been explicitly set using <code>setComment</code>.
+ * @return the title of the set
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set the title of the set. The title is used
+ * as the comment when the set is committed if no comment
+ * has been explicitly set using <code>setComment</code>.
+ * @param title the title of the set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ getManager().titleChanged(this);
+ }
+
+ /**
+ * Get the comment of this change set. If the comment
+ * as never been set, the title is returned as the comment
+ * @return the comment to be used when the set is committed
+ */
+ public String getComment() {
+ if (comment == null) {
+ return getTitle();
+ }
+ return comment;
+ }
+
+ /**
+ * Set the comment to be used when the change set is committed.
+ * If <code>null</code> is passed, the title of the set
+ * will be used as the comment.
+ * @param comment the comment for the set or <code>null</code>
+ * if the title should be the comment
+ */
+ public void setComment(String comment) {
+ if (comment != null && comment.equals(getTitle())) {
+ this.comment = null;
+ } else {
+ this.comment = comment;
+ }
+ }
+
+ /**
+ * Remove the resource from the set.
+ * @param resource the resource to be removed
+ */
+ public void remove(IResource resource) {
+ if (this.resources.remove(resource)) {
+ getManager().resourceChanged(this, resource);
+ }
+ }
+
+ /**
+ * Remove the resources from the set.
+ * @param resources the resources to be removed
+ */
+ public void remove(IResource[] resources) {
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ remove(resource);
+ }
+ }
+
+ /**
+ * The given resource was removed. Ensure that it and
+ * any descendants are also removed.
+ */
+ public void rootRemoved(IResource root) {
+ for (Iterator iter = resources.iterator(); iter.hasNext();) {
+ IResource resource = (IResource) iter.next();
+ if (root.getFullPath().isPrefixOf(resource.getFullPath())) {
+ remove(resource);
+ }
+ }
+ }
+
+ /**
+ * Add the resource to this set if it is modified
+ * w.r.t. the subscriber.
+ * @param resource
+ * @throws TeamException
+ */
+ public void add(IResource resource) throws TeamException {
+ if (addResource(resource)) {
+ getManager().resourceAdded(this, resource);
+ }
+ }
+
+ /**
+ * Add the resources to this set if they are modified
+ * w.r.t. the subscriber.
+ * @param resources the resources to be added.
+ * @throws TeamException
+ */
+ public void add(IResource[] resources) throws TeamException {
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ add(resource);
+ }
+ }
+
+ private boolean addResource(IResource resource) throws TeamException {
+ if (getManager().isModified(resource)) {
+ resources.add(resource);
+ return true;
+ }
+ return false;
+ }
+
+ private SubscriberChangeSetManager getManager() {
+ return manager;
+ }
+
+ /**
+ * Return whether the set contains any files.
+ * @return whether the set contains any files
+ */
+ public boolean isEmpty() {
+ return resources.isEmpty();
+ }
+
+ /**
+ * Return true if the given file is included in this set.
+ * @param local a ocal file
+ * @return true if the given file is included in this set
+ */
+ public boolean contains(IResource local) {
+ return resources.contains(local);
+ }
+
+ /**
+ * Return whether the set has a comment that differs from the title.
+ * @return whether the set has a comment that differs from the title
+ */
+ public boolean hasComment() {
+ return comment != null;
+ }
+
+ /**
+ * Return the resources that are contained in this set.
+ * @return the resources that are contained in this set
+ */
+ public IResource[] getResources() {
+ return (IResource[]) resources.toArray(new IResource[resources.size()]);
+ }
+
+ public void save(Preferences prefs) {
+ prefs.put(CTX_TITLE, getTitle());
+ if (comment != null) {
+ prefs.put(CTX_COMMENT, comment);
+ }
+ if (!resources.isEmpty()) {
+ StringBuffer buffer = new StringBuffer();
+ for (Iterator iter = resources.iterator(); iter.hasNext();) {
+ IResource resource = (IResource) iter.next();
+ buffer.append(resource.getFullPath().toString());
+ buffer.append('\n');
+ }
+ prefs.put(CTX_RESOURCES, buffer.toString());
+ }
+ }
+
+ public void init(Preferences prefs) {
+ title = prefs.get(CTX_TITLE, ""); //$NON-NLS-1$
+ comment = prefs.get(CTX_COMMENT, null);
+ String resourcePaths = prefs.get(CTX_RESOURCES, null);
+ if (resourcePaths != null) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ StringTokenizer tokenizer = new StringTokenizer(resourcePaths, "\n"); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String next = tokenizer.nextToken();
+ if (next.trim().length() > 0) {
+ IResource resource = root.findMember(next);
+ if (resource != null) {
+ try {
+ addResource(resource);
+ } catch (TeamException e) {
+ TeamPlugin.log(e);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/IChangeSetChangeListener.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/IChangeSetChangeListener.java
new file mode 100644
index 000000000..888995c6b
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/IChangeSetChangeListener.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.core.change;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Interface for registering change set change listeners with
+ * the change set manager.
+ */
+public interface IChangeSetChangeListener {
+
+ /**
+ * The given set has been added to the set manager.
+ * @param set the added set
+ */
+ void setAdded(ChangeSet set);
+
+ /**
+ * The default change set has change to be the given set.
+ * All new modifications will be placed in the default
+ * set.
+ * @param set the default set
+ */
+ void defaultSetChanged(ChangeSet set);
+
+ /**
+ * The given set has been removed from the set manager.
+ * @param set the removed set
+ */
+ void setRemoved(ChangeSet set);
+
+ /**
+ * The title of the given set has changed.
+ * @param set the set whose title changed
+ */
+ void titleChanged(ChangeSet set);
+
+ /**
+ * The state of the given resources have change with respect to the
+ * given set. This means that the resource have either been added
+ * or removed from the set. Callers can use the resources contained
+ * in the set to determine if each resource is an addition or removal.
+ * @param set the set that has changed
+ * @param resources the resources whose containment state has changed w.r.t the set
+ */
+ void resourcesChanged(ChangeSet set, IResource[] resources);
+
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/SubscriberChangeSetManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/SubscriberChangeSetManager.java
new file mode 100644
index 000000000..17ffaed2f
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/change/SubscriberChangeSetManager.java
@@ -0,0 +1,594 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.core.change;
+
+import java.util.*;
+
+import org.eclipse.core.internal.runtime.ListenerList;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.subscribers.Subscriber;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.internal.core.BackgroundEventHandler;
+import org.eclipse.team.internal.core.TeamPlugin;
+import org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * This class manages the change sets associated with a subscriber.
+ */
+public class SubscriberChangeSetManager extends SubscriberResourceCollector {
+
+ private static final String PREF_CHANGE_SETS = "changeSets"; //$NON-NLS-1$
+ private static final String CTX_DEFAULT_SET = "defaultSet"; //$NON-NLS-1$
+
+ private static final int RESOURCE_REMOVAL = 1;
+ private static final int RESOURCE_CHANGE = 2;
+
+ private static final int SET_RESOURCE_CHANGE = 3;
+ private static final int SET_TITLE_CHANGE = 4;
+ private static final int SET_ADDED = 5;
+ private static final int SET_REMOVED = 6;
+ private static final int DEFAULT_SET_CHANGED = 7;
+
+ private List activeSets;
+ private ListenerList listeners = new ListenerList();
+ private ChangeSet defaultSet;
+ private EventHandler handler;
+
+ private class SetEvent extends BackgroundEventHandler.Event {
+ private final ChangeSet set;
+ public SetEvent(ChangeSet set, IResource resource, int type) {
+ super(resource, type, IResource.DEPTH_ZERO);
+ this.set = set;
+ }
+ public ChangeSet getSet() {
+ return set;
+ }
+ }
+
+ /*
+ * Background event handler for serializing and batching change set changes
+ */
+ private class EventHandler extends BackgroundEventHandler {
+
+ private List dispatchEvents = new ArrayList();
+
+ protected EventHandler(String jobName, String errorTitle) {
+ super(jobName, errorTitle);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.BackgroundEventHandler#processEvent(org.eclipse.team.internal.core.BackgroundEventHandler.Event, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected void processEvent(Event event, IProgressMonitor monitor) throws CoreException {
+ switch (event.getType()) {
+ case RESOURCE_REMOVAL:
+ handleRemove(event.getResource());
+ break;
+ case RESOURCE_CHANGE:
+ handleChange(event.getResource(), event.getDepth());
+ break;
+ default:
+ // All other events are handled in the dispatch
+ dispatchEvents.add(event);
+ break;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.BackgroundEventHandler#doDispatchEvents(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected boolean doDispatchEvents(IProgressMonitor monitor) throws TeamException {
+ if (dispatchEvents.isEmpty()) {
+ return false;
+ }
+ try {
+ // Try our best to compress the events
+ Set addedSets = new HashSet();
+ Set removedSets = new HashSet();
+ Set titleChanges = new HashSet();
+ Map resourceChanges = new HashMap();
+ boolean defaultSetChange = false;
+ for (Iterator iter = dispatchEvents.iterator(); iter.hasNext();) {
+ Event event = (Event) iter.next();
+ if (event instanceof SetEvent) {
+ SetEvent setEvent = (SetEvent)event;
+ ChangeSet set = setEvent.getSet();
+ switch (event.getType()) {
+ case SET_ADDED:
+ addedSets.add(set);
+ break;
+ case SET_REMOVED:
+ removedSets.add(set);
+ addedSets.remove(set);
+ titleChanges.remove(set);
+ resourceChanges.remove(set);
+ break;
+ case SET_TITLE_CHANGE:
+ titleChanges.add(set);
+ break;
+ case SET_RESOURCE_CHANGE:
+ Set changes = (Set)resourceChanges.get(set);
+ if (changes == null) {
+ changes = new HashSet();
+ resourceChanges.put(set, changes);
+ }
+ changes.add(event.getResource());
+ break;
+ case DEFAULT_SET_CHANGED:
+ defaultSetChange = true;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ // Fire off the events in the order added, removed, title, changes, default
+ for (Iterator iter = addedSets.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ setAdded(set);
+ }
+ for (Iterator iter = removedSets.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ setRemoved(set);
+ }
+ for (Iterator iter = titleChanges.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ titleChanged(set);
+ }
+ for (Iterator iter = resourceChanges.keySet().iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ Set resources = (Set)resourceChanges.get(set);
+ resourcesChanged(set, (IResource[]) resources.toArray(new IResource[resources.size()]));
+ }
+ if (defaultSetChange) {
+ defaultChanged(defaultSet);
+ }
+ } finally {
+ dispatchEvents.clear();
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.BackgroundEventHandler#queueEvent(org.eclipse.team.internal.core.BackgroundEventHandler.Event, boolean)
+ */
+ protected synchronized void queueEvent(Event event, boolean front) {
+ // Override to allow access from enclosing class
+ super.queueEvent(event, front);
+ }
+
+ /*
+ * Handle the removal
+ */
+ private void handleRemove(IResource resource) {
+ for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ // This will remove any descendants from the set and callback to
+ // resourcesChanged which will batch changes
+ if (!set.isEmpty()) {
+ set.rootRemoved(resource);
+ if (set.isEmpty()) {
+ remove(set);
+ }
+ }
+ }
+ }
+
+ /*
+ * Handle the change
+ */
+ private void handleChange(IResource resource, int depth) throws TeamException {
+ if (isModified(resource)) {
+ // Consider for inclusion in the default set
+ // if the resource is not already a memebr of another set
+ considerForDefaultSet(resource);
+ } else {
+ removeFromAllSets(resource);
+ }
+ if (depth != IResource.DEPTH_ZERO) {
+ IResource[] members = getSubscriber().members(resource);
+ for (int i = 0; i < members.length; i++) {
+ IResource member = members[i];
+ handleChange(member, depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : IResource.DEPTH_INFINITE);
+ }
+ }
+ }
+
+ private void removeFromAllSets(IResource resource) {
+ for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ if (set.contains(resource)) {
+ set.remove(resource);
+ if (set.isEmpty()) {
+ remove(set);
+ }
+ }
+ }
+ }
+
+ private void considerForDefaultSet(IResource resource) throws TeamException {
+ if (defaultSet != null && !isInActiveSet(resource)) {
+ defaultSet.add(resource);
+ }
+ }
+
+ private boolean isInActiveSet(IResource resource) {
+ for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
+ ChangeSet set = (ChangeSet) iter.next();
+ if (set.contains(resource)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private Object[] getListeners() {
+ return listeners.getListeners();
+ }
+
+ private void titleChanged(final ChangeSet set) {
+ if (activeSets.contains(set)) {
+ Object[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exceptions are logged by the platform
+ }
+ public void run() throws Exception {
+ listener.titleChanged(set);
+ }
+ });
+ }
+ }
+ }
+
+ private void setAdded(final ChangeSet set) {
+ Object[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exceptions are logged by the platform
+ }
+ public void run() throws Exception {
+ listener.setAdded(set);
+ }
+ });
+ }
+ }
+
+ private void setRemoved(final ChangeSet set) {
+ Object[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exceptions are logged by the platform
+ }
+ public void run() throws Exception {
+ listener.setRemoved(set);
+ }
+ });
+ }
+ }
+
+ private void defaultChanged(ChangeSet set) {
+ Object[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exceptions are logged by the platform
+ }
+ public void run() throws Exception {
+ listener.defaultSetChanged(defaultSet);
+ }
+ });
+ }
+ }
+
+ private void resourcesChanged(final ChangeSet set, final IResource[] files) {
+ Object[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IChangeSetChangeListener listener = (IChangeSetChangeListener) listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exceptions are logged by the platform
+ }
+ public void run() throws Exception {
+ listener.resourcesChanged(set, files);
+ }
+ });
+ }
+ }
+ }
+
+ public SubscriberChangeSetManager(Subscriber subscriber) {
+ super(subscriber);
+ load();
+ handler = new EventHandler("Updating Change Sets for {0}" + subscriber.getName(), "Errors occurred while updating the change sets for {0}" + subscriber.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#remove(org.eclipse.core.resources.IResource)
+ */
+ protected void remove(IResource resource) {
+ handler.queueEvent(new BackgroundEventHandler.Event(resource, RESOURCE_REMOVAL, IResource.DEPTH_INFINITE), false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#change(org.eclipse.core.resources.IResource, int)
+ */
+ protected void change(IResource resource, int depth) {
+ handler.queueEvent(new BackgroundEventHandler.Event(resource, RESOURCE_CHANGE, depth), false);
+ }
+
+ /**
+ * The title of the given set has changed. Notify any listeners.
+ */
+ /* package */ void titleChanged(final ChangeSet set) {
+ if (activeSets.contains(set)) {
+ handler.queueEvent(new SetEvent(set, ResourcesPlugin.getWorkspace().getRoot(), SET_TITLE_CHANGE), false);
+ }
+ }
+
+ /**
+ * Return whether the manager allows a resource to
+ * be in mulitple sets. By default, a resource
+ * may only be in one set.
+ * @return whether the manager allows a resource to
+ * be in mulitple sets.
+ */
+ protected boolean isSingleSetPerResource() {
+ return true;
+ }
+
+ /*
+ * Callback that is invoked from a ChangeSet when a resource
+ * has been added to the set. The add may have been done by
+ * a third party (i.e. not the manager) so make sure the
+ * resource does not exist in other sets.
+ */
+ /* package */ void resourceAdded(final ChangeSet set, IResource resource) {
+ resourceChanged(set, resource);
+ if (isSingleSetPerResource()) {
+ // Remove the added files from any other set that contains them
+ for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
+ ChangeSet otherSet = (ChangeSet) iter.next();
+ if (otherSet != set) {
+ otherSet.remove(resource);
+ }
+ }
+ }
+ }
+
+ /*
+ * Callback that is invoked from a ChangeSet when the state of
+ * a resource in the set has changed. Changes will be batched and
+ * a change event fired in a background thread.
+ */
+ /* package */ void resourceChanged(ChangeSet set, IResource resource) {
+ if (activeSets.contains(set)) {
+ handler.queueEvent(new SetEvent(set, resource, SET_RESOURCE_CHANGE), false);
+ }
+ }
+
+ /**
+ * Create a commit set with the given title and files. The created
+ * set is not added to the control of the commit set manager
+ * so no events are fired. The set can be added using the
+ * <code>add</code> method.
+ * @param title the title of the commit set
+ * @param files the files contained in the set
+ * @return the created set
+ * @throws CVSException
+ */
+ public ChangeSet createSet(String title, IResource[] files) throws TeamException {
+ ChangeSet commitSet = new ChangeSet(this, title);
+ if (files != null && files.length > 0)
+ commitSet.add(files);
+ return commitSet;
+ }
+
+ /**
+ * Add the set to the list of active sets.
+ * @param set the set to be added
+ */
+ public void add(final ChangeSet set) {
+ if (!contains(set)) {
+ activeSets.add(set);
+ handler.queueEvent(new SetEvent(set, ResourcesPlugin.getWorkspace().getRoot(), SET_ADDED), false);
+ }
+ }
+
+ /**
+ * Remove the set from the list of active sets.
+ * @param set the set to be removed
+ */
+ public void remove(final ChangeSet set) {
+ if (contains(set)) {
+ activeSets.remove(set);
+ handler.queueEvent(new SetEvent(set, ResourcesPlugin.getWorkspace().getRoot(), SET_REMOVED), false);
+ }
+ }
+
+ /**
+ * Return whether the manager contains the given commit set
+ * @param set the commit set being tested
+ * @return whether the set is contained in the manager's list of active sets
+ */
+ public boolean contains(ChangeSet set) {
+ return activeSets.contains(set);
+ }
+
+ /**
+ * Add the listener to the set of registered listeners.
+ * @param listener the listener to be added
+ */
+ public void addListener(IChangeSetChangeListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * Remove the listener from the set of registered listeners.
+ * @param listener the listener to remove
+ */
+ public void removeListener(IChangeSetChangeListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * Return the list of active commit sets.
+ * @return the list of active commit sets
+ */
+ public ChangeSet[] getSets() {
+ return (ChangeSet[]) activeSets.toArray(new ChangeSet[activeSets.size()]);
+ }
+
+ /**
+ * Make the given set the default set into which all new modifications
+ * that ae not already in another set go.
+ * @param set the set which is to become the default set
+ */
+ public void makeDefault(ChangeSet set) {
+ defaultSet = set;
+ handler.queueEvent(new SetEvent(set, ResourcesPlugin.getWorkspace().getRoot(), DEFAULT_SET_CHANGED), false);
+ }
+
+ /**
+ * Retrn the set which is currently the default or
+ * <code>null</code> if there is no default set.
+ * @return
+ */
+ public ChangeSet getDefaultSet() {
+ return defaultSet;
+ }
+ /**
+ * Return whether the given set is the default set into which all
+ * new modifications will be placed.
+ * @param set the set to test
+ * @return whether the set is the default set
+ */
+ public boolean isDefault(ChangeSet set) {
+ return set == defaultSet;
+ }
+
+ /**
+ * Return whether the resource is modified locally w.r.t.
+ * the subscriber.
+ * @param resource the resource
+ * @return whether the resource is modified locally
+ * @throws TeamException
+ */
+ protected boolean isModified(IResource resource) throws TeamException {
+ Subscriber subscriber = getSubscriber();
+ SyncInfo info = subscriber.getSyncInfo(resource);
+ if (info != null) {
+ if (info.getComparator().isThreeWay()) {
+ int dir = (info.getKind() & SyncInfo.DIRECTION_MASK);
+ return dir == SyncInfo.OUTGOING || dir == SyncInfo.CONFLICTING;
+ } else {
+ return (info.getKind() & SyncInfo.CHANGE_MASK) == SyncInfo.CHANGE;
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#dispose()
+ */
+ public void dispose() {
+ handler.shutdown();
+ super.dispose();
+ save();
+ }
+
+ private void save() {
+ Preferences prefs = getPreferences();
+ for (Iterator it = activeSets.iterator(); it.hasNext(); ) {
+ ChangeSet set = (ChangeSet) it.next();
+ if (!set.isEmpty()) {
+ Preferences child = prefs.node(set.getTitle());
+ set.save(child);
+ }
+ }
+ if (defaultSet != null) {
+ prefs.put(CTX_DEFAULT_SET, defaultSet.getTitle());
+ }
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ TeamPlugin.log(IStatus.ERROR, "An error occurred saving the change set state for {0}" + getSubscriber().getName(), e);
+ }
+ }
+
+ private void load() {
+ activeSets = new ArrayList();
+ Preferences prefs = getPreferences();
+ String defaultSetTitle = prefs.get(CTX_DEFAULT_SET, null);
+ try {
+ String[] childNames = prefs.childrenNames();
+ for (int i = 0; i < childNames.length; i++) {
+ String string = childNames[i];
+ Preferences childPrefs = prefs.node(string);
+ ChangeSet set = createSet(string, childPrefs);
+ if (defaultSet == null && defaultSetTitle != null && set.getTitle().equals(defaultSetTitle)) {
+ defaultSet = set;
+ }
+ activeSets.add(set);
+ }
+ } catch (BackingStoreException e) {
+ TeamPlugin.log(IStatus.ERROR, "An error occurred restoring the change set state for {0}" + getSubscriber().getName(), e);
+ }
+ }
+
+ /**
+ * Create a change set from the given preferences that were
+ * previously saved.
+ * @param childPrefs the previously saved preferences
+ * @return the created change set
+ */
+ protected ChangeSet createSet(String title, Preferences childPrefs) {
+ ChangeSet changeSet = new ChangeSet(this, title);
+ changeSet.init(childPrefs);
+ return changeSet;
+ }
+
+ private Preferences getPreferences() {
+ return getParentPreferences().node(getSubscriberIdentifier());
+ }
+
+ private static Preferences getParentPreferences() {
+ return getTeamPreferences().node(PREF_CHANGE_SETS);
+ }
+
+ private static Preferences getTeamPreferences() {
+ IPreferencesService service = Platform.getPreferencesService();
+ IEclipsePreferences root = service.getRootNode();
+ return root.node(InstanceScope.SCOPE).node(TeamPlugin.getPlugin().getBundle().getSymbolicName());
+ }
+
+ /**
+ * Return the id that will uniquely identify the subscriber accross
+ * restarts.
+ * @return
+ */
+ protected String getSubscriberIdentifier() {
+ return getSubscriber().getName();
+ }
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberResourceCollector.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberResourceCollector.java
new file mode 100644
index 000000000..9f5122f68
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberResourceCollector.java
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.core.subscribers;
+
+import org.eclipse.core.resources.*;
+import org.eclipse.team.core.subscribers.*;
+import org.eclipse.team.internal.core.Assert;
+
+/**
+ * This class acts as a superclass for any class that is collecting subscriber
+ * resources. It provides funtionality that listens to resource deltas and subscriber change events
+ * in order to determine when the state of resources that are supervised by a subscriber may have changed.
+ */
+public abstract class SubscriberResourceCollector implements IResourceChangeListener, ISubscriberChangeListener {
+
+ Subscriber subscriber;
+
+ /**
+ * Create the collector and register it as a listener with the workspace
+ * and the subscriber.
+ */
+ public SubscriberResourceCollector(Subscriber subscriber) {
+ Assert.isNotNull(subscriber);
+ this.subscriber = subscriber;
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
+ subscriber.addListener(this);
+ }
+
+ /**
+ * Returns the <code>Subscriber</code> associated with this collector.
+ *
+ * @return the <code>Subscriber</code> associated with this collector.
+ */
+ public Subscriber getSubscriber() {
+ return subscriber;
+ }
+
+ /**
+ * Deregister the listeners for this collector.
+ */
+ public void dispose() {
+ getSubscriber().removeListener(this);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.sync.ITeamResourceChangeListener#teamResourceChanged(org.eclipse.team.core.sync.TeamDelta[])
+ */
+ public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas) {
+ try {
+ beginInput();
+ IResource[] roots = getRoots();
+ for (int i = 0; i < deltas.length; i++) {
+ switch (deltas[i].getFlags()) {
+ case ISubscriberChangeEvent.SYNC_CHANGED :
+ if (isAllRootsIncluded() || isDescendantOfRoot(deltas[i].getResource(), roots)) {
+ change(deltas[i].getResource(), IResource.DEPTH_ZERO);
+ }
+ break;
+ case ISubscriberChangeEvent.ROOT_REMOVED :
+ remove(deltas[i].getResource());
+ break;
+ case ISubscriberChangeEvent.ROOT_ADDED :
+ if (isAllRootsIncluded() || isDescendantOfRoot(deltas[i].getResource(), roots)) {
+ change(deltas[i].getResource(), IResource.DEPTH_INFINITE);
+ }
+ break;
+ }
+ }
+ } finally {
+ endInput();
+ }
+ }
+
+ /**
+ * This method is invoked at the beginning of a subscriber change event
+ * or resource delta event. The endInput methos will be invoked at some point
+ * following this. There may be several invokations of remove or change
+ * in between.
+ */
+ protected void beginInput() {
+ // Do nothing by default
+ }
+
+ /**
+ * The processing of the resource or subscriber delta has finished.
+ * Subclasses can accumulate removals and changes and handle them
+ * at this point to allow batched change events.
+ */
+ private void endInput() {
+ // Do nothing by default
+ }
+
+
+ /*(non-Javadoc)
+ * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ try {
+ beginInput();
+ processDelta(event.getDelta(), getRoots());
+ } finally {
+ endInput();
+ }
+ }
+
+ /**
+ * Process the resource delta and posts all necessary events to the background
+ * event handler.
+ *
+ * @param delta the resource delta to analyse
+ */
+ protected void processDelta(IResourceDelta delta, IResource[] roots) {
+ IResource resource = delta.getResource();
+ int kind = delta.getKind();
+
+ if (resource.getType() == IResource.PROJECT) {
+ // Handle a deleted project
+ if (((kind & IResourceDelta.REMOVED) != 0)) {
+ remove(resource);
+ return;
+ }
+ // Handle a closed project
+ if ((delta.getFlags() & IResourceDelta.OPEN) != 0 && !((IProject) resource).isOpen()) {
+ remove(resource);
+ return;
+ }
+ // Only interested in projects mapped to the provider
+ if (!isAncestorOfRoot(resource, roots)) {
+ // If the project has any entries in the sync set, remove them
+ if (hasMembers(resource)) {
+ remove(resource);
+ }
+ return;
+ }
+ }
+
+ boolean visitChildren = false;
+ if (isDescendantOfRoot(resource, roots)) {
+ visitChildren = true;
+ // If the resource has changed type, remove the old resource handle
+ // and add the new one
+ if ((delta.getFlags() & IResourceDelta.TYPE) != 0) {
+ remove(resource);
+ change(resource, IResource.DEPTH_INFINITE);
+ }
+
+ // Check the flags for changes the SyncSet cares about.
+ // Notice we don't care about MARKERS currently.
+ int changeFlags = delta.getFlags();
+ if ((changeFlags & (IResourceDelta.OPEN | IResourceDelta.CONTENT)) != 0) {
+ change(resource, IResource.DEPTH_ZERO);
+ }
+
+ // Check the kind and deal with those we care about
+ if ((delta.getKind() & (IResourceDelta.REMOVED | IResourceDelta.ADDED)) != 0) {
+ change(resource, IResource.DEPTH_ZERO);
+ }
+ }
+
+ // Handle changed children
+ if (visitChildren || isAncestorOfRoot(resource, roots)) {
+ IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.REMOVED | IResourceDelta.ADDED);
+ for (int i = 0; i < affectedChildren.length; i++) {
+ processDelta(affectedChildren[i], roots);
+ }
+ }
+ }
+
+ /**
+ * Return the root resources that are to be considered by this handler.
+ * These may be either the subscriber roots or a set of resources that are
+ * contained by the subscriber's roots.
+ * @return the root resources that are to be considered by this handler
+ */
+ protected IResource[] getRoots() {
+ return getSubscriber().roots();
+ }
+
+ /**
+ * Return whether the given resource, which is not
+ * within the roots of this handler, has children
+ * that are.
+ * @param resource the resource
+ * @return whether the resource has children that are being considered
+ * by this handler.
+ */
+ protected boolean hasMembers(IResource resource) {
+ IResource[] roots = getRoots();
+ for (int i = 0; i < roots.length; i++) {
+ IResource root = roots[i];
+ if (resource.getFullPath().isPrefixOf(root.getFullPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Remove the resource from any sets since it is no longer relevant,
+ * @param resource the resource to be removed.
+ */
+ protected abstract void remove(IResource resource);
+
+ /**
+ * The resource sync state has changed to the depth specified
+ * @param resource the resource
+ * @param depth the depth
+ */
+ protected abstract void change(IResource resource, int depth);
+
+ /**
+ * Return whether all roots of a subscriber are included or
+ * if the collector is only consider a subset of the resources.
+ * @return whether all roots of a subscriber are included
+ */
+ protected boolean isAllRootsIncluded() {
+ return true;
+ }
+
+ private boolean isAncestorOfRoot(IResource parent, IResource[] roots) {
+ // Always traverse into projects in case a root was removed
+ if (parent.getType() == IResource.ROOT) return true;
+ for (int i = 0; i < roots.length; i++) {
+ IResource resource = roots[i];
+ if (parent.getFullPath().isPrefixOf(resource.getFullPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isDescendantOfRoot(IResource resource, IResource[] roots) {
+ for (int i = 0; i < roots.length; i++) {
+ IResource root = roots[i];
+ if (root.getFullPath().isPrefixOf(resource.getFullPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberSyncInfoCollector.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberSyncInfoCollector.java
index 3d1b64580..b9de6d77c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberSyncInfoCollector.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberSyncInfoCollector.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.team.internal.core.subscribers;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.team.core.subscribers.*;
+import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.*;
-import org.eclipse.team.internal.core.Assert;
import org.eclipse.team.internal.core.Policy;
/**
@@ -29,12 +28,11 @@ import org.eclipse.team.internal.core.Policy;
* </p>
* @since 3.0
*/
-public final class SubscriberSyncInfoCollector implements IResourceChangeListener, ISubscriberChangeListener {
+public final class SubscriberSyncInfoCollector extends SubscriberResourceCollector {
private SyncSetInputFromSubscriber subscriberInput;
private SyncSetInputFromSyncSet filteredInput;
private SubscriberEventHandler eventHandler;
- private Subscriber subscriber;
private IResource[] roots;
/**
@@ -47,9 +45,8 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
* @param roots the roots of the out-of-sync resources to be collected
*/
public SubscriberSyncInfoCollector(Subscriber subscriber, IResource[] roots) {
+ super(subscriber);
this.roots = roots;
- this.subscriber = subscriber;
- Assert.isNotNull(subscriber);
this.eventHandler = new SubscriberEventHandler(subscriber, roots);
this.subscriberInput = eventHandler.getSyncSetInput();
filteredInput = new SyncSetInputFromSyncSet(subscriberInput.getSyncSet(), getEventHandler());
@@ -58,8 +55,7 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
return true;
}
});
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- subscriber.addListener(this);
+
}
public void setProgressGroup(IProgressMonitor monitor, int ticks) {
@@ -103,15 +99,6 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
}
/**
- * Returns the <code>Subscriber</code> associated with this collector.
- *
- * @return the <code>Subscriber</code> associated with this collector.
- */
- public Subscriber getSubscriber() {
- return subscriber;
- }
-
- /**
* Disposes of the background job associated with this collector and deregisters
* all it's listeners. This method must be called when the collector is no longer
* referenced and could be garbage collected.
@@ -122,93 +109,7 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
if(filteredInput != null) {
filteredInput.disconnect();
}
- getSubscriber().removeListener(this);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- }
-
- /**
- * Process the resource delta and posts all necessary events to the background
- * event handler.
- *
- * @param delta the resource delta to analyse
- */
- private void processDelta(IResourceDelta delta, IResource[] roots) {
- IResource resource = delta.getResource();
- int kind = delta.getKind();
-
- if (resource.getType() == IResource.PROJECT) {
- // Handle a deleted project
- if (((kind & IResourceDelta.REMOVED) != 0)) {
- eventHandler.remove(resource);
- return;
- }
- // Handle a closed project
- if ((delta.getFlags() & IResourceDelta.OPEN) != 0 && !((IProject) resource).isOpen()) {
- eventHandler.remove(resource);
- return;
- }
- // Only interested in projects mapped to the provider
- if (!isAncestorOfRoot(resource, roots)) {
- // If the project has any entries in the sync set, remove them
- if (getSubscriberSyncInfoSet().hasMembers(resource)) {
- eventHandler.remove(resource);
- }
- return;
- }
- }
-
- boolean visitChildren = false;
- if (isDescendantOfRoot(resource, roots)) {
- visitChildren = true;
- // If the resource has changed type, remove the old resource handle
- // and add the new one
- if ((delta.getFlags() & IResourceDelta.TYPE) != 0) {
- eventHandler.remove(resource);
- eventHandler.change(resource, IResource.DEPTH_INFINITE);
- }
-
- // Check the flags for changes the SyncSet cares about.
- // Notice we don't care about MARKERS currently.
- int changeFlags = delta.getFlags();
- if ((changeFlags & (IResourceDelta.OPEN | IResourceDelta.CONTENT)) != 0) {
- eventHandler.change(resource, IResource.DEPTH_ZERO);
- }
-
- // Check the kind and deal with those we care about
- if ((delta.getKind() & (IResourceDelta.REMOVED | IResourceDelta.ADDED)) != 0) {
- eventHandler.change(resource, IResource.DEPTH_ZERO);
- }
- }
-
- // Handle changed children
- if (visitChildren || isAncestorOfRoot(resource, roots)) {
- IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.REMOVED | IResourceDelta.ADDED);
- for (int i = 0; i < affectedChildren.length; i++) {
- processDelta(affectedChildren[i], roots);
- }
- }
- }
-
- private boolean isAncestorOfRoot(IResource parent, IResource[] roots) {
- // Always traverse into projects in case a root was removed
- if (parent.getType() == IResource.ROOT) return true;
- for (int i = 0; i < roots.length; i++) {
- IResource resource = roots[i];
- if (parent.getFullPath().isPrefixOf(resource.getFullPath())) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isDescendantOfRoot(IResource resource, IResource[] roots) {
- for (int i = 0; i < roots.length; i++) {
- IResource root = roots[i];
- if (root.getFullPath().isPrefixOf(resource.getFullPath())) {
- return true;
- }
- }
- return false;
+ super.dispose();
}
/**
@@ -219,7 +120,7 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
*/
public IResource[] getRoots() {
if (roots == null) {
- return getSubscriber().roots();
+ return super.getRoots();
} else {
return roots;
}
@@ -234,41 +135,6 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
public boolean isAllRootsIncluded() {
return roots == null;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- processDelta(event.getDelta(), getRoots());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.team.core.sync.ITeamResourceChangeListener#teamResourceChanged(org.eclipse.team.core.sync.TeamDelta[])
- */
- public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas) {
- IResource[] roots = getRoots();
- for (int i = 0; i < deltas.length; i++) {
- switch (deltas[i].getFlags()) {
- case ISubscriberChangeEvent.SYNC_CHANGED :
- if (isAllRootsIncluded() || isDescendantOfRoot(deltas[i].getResource(), roots)) {
- eventHandler.change(deltas[i].getResource(), IResource.DEPTH_ZERO);
- }
- break;
- case ISubscriberChangeEvent.ROOT_REMOVED :
- eventHandler.remove(deltas[i].getResource());
- break;
- case ISubscriberChangeEvent.ROOT_ADDED :
- if (isAllRootsIncluded() || isDescendantOfRoot(deltas[i].getResource(), roots)) {
- eventHandler.change(deltas[i].getResource(), IResource.DEPTH_INFINITE);
- }
- break;
- }
- }
- }
/**
* Return the event handler that performs the background processing for this collector.
@@ -325,4 +191,25 @@ public final class SubscriberSyncInfoCollector implements IResourceChangeListene
this.roots = roots;
reset();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#hasMembers(org.eclipse.core.resources.IResource)
+ */
+ protected boolean hasMembers(IResource resource) {
+ return getSubscriberSyncInfoSet().hasMembers(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#remove(org.eclipse.core.resources.IResource)
+ */
+ protected void remove(IResource resource) {
+ eventHandler.remove(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.core.subscribers.SubscriberResourceCollector#change(org.eclipse.core.resources.IResource, int)
+ */
+ protected void change(IResource resource, int depth) {
+ eventHandler.change(resource, depth);
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 0d68dc069..fd1ee9071 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -707,7 +707,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
console.shutdown();
- CommitSetManager.getInstance().shutdown();
+ CommitSetManager.getInstance().dispose();
} finally {
super.stop(context);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
index bb0e29cb3..0bfc7c93a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
@@ -14,25 +14,15 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IFontDecorator;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.team.core.change.ChangeSet;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.ui.CVSDecoration;
-import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
@@ -76,7 +66,7 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
}
}
if (element instanceof CommitSetDiffNode) {
- CommitSet set = ((CommitSetDiffNode)element).getSet();
+ ChangeSet set = ((CommitSetDiffNode)element).getSet();
if (CommitSetManager.getInstance().isDefault(set)) {
text = Policy.bind("CommitSetDiffNode.0", text); //$NON-NLS-1$
}
@@ -145,7 +135,7 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
public Font decorateFont(Object element) {
if (element instanceof CommitSetDiffNode) {
- CommitSet set = ((CommitSetDiffNode)element).getSet();
+ ChangeSet set = ((CommitSetDiffNode)element).getSet();
if (CommitSetManager.getInstance().isDefault(set)) {
if (boldFont == null) {
Font defaultFont = JFaceResources.getDefaultFont();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
index 3da3231b6..d5a07a8ed 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
@@ -29,6 +29,8 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.change.ChangeSet;
+import org.eclipse.team.core.change.IChangeSetChangeListener;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.*;
@@ -63,7 +65,7 @@ import org.eclipse.ui.progress.UIJob;
*
* @since 3.0
*/
-public class ChangeLogModelProvider extends CompositeModelProvider implements ICommitSetChangeListener {
+public class ChangeLogModelProvider extends CompositeModelProvider implements IChangeSetChangeListener {
// Log operation that is used to fetch revision histories from the server. It also
// provides caching so we keep it around.
private LogEntryCache logs;
@@ -159,14 +161,14 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
public void run() {
try {
IResource[] resources = Utils.getResources(getSelectedDiffElements());
- CommitSet set = CommitSetManager.getInstance().createCommitSet(Policy.bind("ChangeLogModelProvider.1"), null); //$NON-NLS-1$
+ ChangeSet set = CommitSetManager.getInstance().createSet(Policy.bind("ChangeLogModelProvider.1"), null); //$NON-NLS-1$
CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, resources,
Policy.bind("ChangeLogModelProvider.2"), Policy.bind("ChangeLogModelProvider.3")); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
- set.addFiles(resources);
+ set.add(resources);
CommitSetManager.getInstance().add(set);
- } catch (CVSException e) {
+ } catch (TeamException e) {
CVSUIPlugin.openError(getConfiguration().getSite().getShell(),
Policy.bind("ChangeLogModelProvider.4a"), Policy.bind("ChangeLogModelProvider.5a"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -192,7 +194,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
return getSelectedSet() != null;
}
- protected CommitSet getSelectedSet() {
+ protected ChangeSet getSelectedSet() {
IStructuredSelection selection = getStructuredSelection();
if (selection.size() == 1) {
Object first = selection.getFirstElement();
@@ -211,9 +213,9 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
public void run() {
- CommitSet set = getSelectedSet();
+ ChangeSet set = getSelectedSet();
if (set == null) return;
- CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, set.getFiles(),
+ CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, set.getResources(),
Policy.bind("ChangeLogModelProvider.7"), Policy.bind("ChangeLogModelProvider.8")); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
@@ -229,7 +231,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
public void run() {
- CommitSet set = getSelectedSet();
+ ChangeSet set = getSelectedSet();
if (set == null) return;
CommitSetManager.getInstance().makeDefault(set);
}
@@ -238,9 +240,9 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private class AddToCommitSetAction extends SynchronizeModelAction {
- private final CommitSet set;
+ private final ChangeSet set;
- public AddToCommitSetAction(ISynchronizePageConfiguration configuration, CommitSet set, ISelection selection) {
+ public AddToCommitSetAction(ISynchronizePageConfiguration configuration, ChangeSet set, ISelection selection) {
super(set.getTitle(), configuration);
this.set = set;
selectionChanged(selection);
@@ -265,8 +267,8 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
try {
- set.addFiles(Utils.getResources(getSelectedDiffElements()));
- } catch (CVSException e) {
+ set.add(Utils.getResources(getSelectedDiffElements()));
+ } catch (TeamException e) {
CVSUIPlugin.openError(getConfiguration().getSite().getShell(),
Policy.bind("ChangeLogModelProvider.10"), Policy.bind("ChangeLogModelProvider.11"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -480,13 +482,13 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
protected void addCommitSets(IMenuManager manager) {
- CommitSet[] sets = CommitSetManager.getInstance().getSets();
+ ChangeSet[] sets = CommitSetManager.getInstance().getSets();
ISelection selection = getContext().getSelection();
createCommitSet.selectionChanged(selection);
addToCommitSet.add(createCommitSet);
addToCommitSet.add(new Separator());
for (int i = 0; i < sets.length; i++) {
- CommitSet set = sets[i];
+ ChangeSet set = sets[i];
AddToCommitSetAction action = new AddToCommitSetAction(getConfiguration(), set, selection);
manager.add(action);
}
@@ -591,6 +593,8 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
};
private static final ChangeLogModelProviderDescriptor descriptor = new ChangeLogModelProviderDescriptor();
+
+ private ChangeSet defaultSet;
public ChangeLogModelProvider(ISynchronizePageConfiguration configuration, SyncInfoSet set, String id) {
super(configuration, set);
@@ -846,7 +850,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
* Add the local change to the appropriate outgoing commit set
*/
private void addLocalChange(SyncInfo info) {
- CommitSet set = getCommitSetFor(info);
+ ChangeSet set = getCommitSetFor(info);
if (set == null) {
addToCommitSetProvider(info, getModelRoot());
} else {
@@ -948,7 +952,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
* Find an existing comment set
* TODO: we could do better than a linear lookup?
*/
- private CommitSetDiffNode getDiffNodeFor(CommitSet set) {
+ private CommitSetDiffNode getDiffNodeFor(ChangeSet set) {
if (set == null) return null;
IDiffElement[] elements = getModelRoot().getChildren();
for (int i = 0; i < elements.length; i++) {
@@ -968,10 +972,10 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
* TODO: we could do better than a linear lookup?
* TODO: can a file be in multiple sets?
*/
- private CommitSet getCommitSetFor(SyncInfo info) {
- CommitSet[] sets = CommitSetManager.getInstance().getSets();
+ private ChangeSet getCommitSetFor(SyncInfo info) {
+ ChangeSet[] sets = CommitSetManager.getInstance().getSets();
for (int i = 0; i < sets.length; i++) {
- CommitSet set = sets[i];
+ ChangeSet set = sets[i];
if (set.contains(info.getLocal())) {
return set;
}
@@ -1241,31 +1245,24 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.ICommitSetChangeListener#setAdded(org.eclipse.team.internal.ccvs.ui.subscriber.CommitSet)
*/
- public void setAdded(CommitSet set) {
- refresh(set.getFiles(), true /* we may not be in the UI thread */);
+ public void setAdded(ChangeSet set) {
+ refresh(set.getResources(), true /* we may not be in the UI thread */);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.ICommitSetChangeListener#setRemoved(org.eclipse.team.internal.ccvs.ui.subscriber.CommitSet)
*/
- public void setRemoved(CommitSet set) {
- refresh(set.getFiles(), true /* we may not be in the UI thread */);
+ public void setRemoved(ChangeSet set) {
+ refresh(set.getResources(), true /* we may not be in the UI thread */);
}
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.subscriber.ICommitSetChangeListener#titleChanged(org.eclipse.team.internal.ccvs.ui.subscriber.CommitSet)
*/
- public void titleChanged(CommitSet set) {
+ public void titleChanged(ChangeSet set) {
// We need to refresh all the files because the title is used
// to cache the commit set (i.e. used as the hashCode in various maps)
- refresh(set.getFiles(), true /* we may not be in the UI thread */);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.ICommitSetChangeListener#filesChanged(org.eclipse.team.internal.ccvs.ui.subscriber.CommitSet, org.eclipse.core.resources.IFile[])
- */
- public void filesChanged(CommitSet set, IFile[] files) {
- refresh(files, true /* we may not be in the UI thread */);
+ refresh(set.getResources(), true /* we may not be in the UI thread */);
}
private void refresh(final IResource[] resources, boolean performSyncExec) {
@@ -1316,19 +1313,6 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
/* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(CommitSetManager.DEFAULT_SET)) {
- CommitSet oldValue = (CommitSet)event.getOldValue();
- refreshNode(getDiffNodeFor(oldValue));
- CommitSet newValue = (CommitSet)event.getNewValue();
- refreshNode(getDiffNodeFor(newValue));
- }
-
- }
-
- /* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.CompositeModelProvider#handleAdditions(org.eclipse.team.core.synchronize.SyncInfo[])
*/
protected void handleAddition(SyncInfo info) {
@@ -1392,5 +1376,25 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
public ViewerSorter getEmbeddedSorter() {
return embeddedSorter;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.change.IChangeSetChangeListener#defaultSetChanged(org.eclipse.team.core.change.ChangeSet)
+ */
+ public void defaultSetChanged(ChangeSet set) {
+ if (defaultSet != null) {
+ refreshNode(getDiffNodeFor(defaultSet));
+ }
+ defaultSet = set;
+ if (defaultSet != null) {
+ refreshNode(getDiffNodeFor(defaultSet));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.change.IChangeSetChangeListener#resourcesChanged(org.eclipse.team.core.change.ChangeSet, org.eclipse.core.resources.IResource[])
+ */
+ public void resourcesChanged(ChangeSet set, IResource[] resources) {
+ refresh(resources, true /* we may not be in the UI thread */);
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java
index 8e55f2d59..a54c6816a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java
@@ -12,6 +12,7 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.team.core.change.ChangeSet;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
@@ -61,8 +62,8 @@ public class ChangeLogModelSorter extends ViewerSorter {
//if one or both objects are not resources, returned a comparison
//based on class.
if (o1 instanceof CommitSetDiffNode && o2 instanceof CommitSetDiffNode) {
- CommitSet s1 = ((CommitSetDiffNode) o1).getSet();
- CommitSet s2 = ((CommitSetDiffNode) o2).getSet();
+ ChangeSet s1 = ((CommitSetDiffNode) o1).getSet();
+ ChangeSet s2 = ((CommitSetDiffNode) o2).getSet();
return compareNames(s1.getTitle(), s2.getTitle());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSet.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSet.java
deleted file mode 100644
index 02e5dbee8..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSet.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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.ui.subscriber;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Commit;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.operations.CommitOperation;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A commit set is used to associate a comment with a set of outgoing
- * file modifications. If the comment of the set is <code>null</code>,
- * the title of the commit set will be used as the comment when committing
- */
-public class CommitSet {
-
- private static final String CTX_REVISION = "revision"; //$NON-NLS-1$
- private static final String CTX_PATH = "path"; //$NON-NLS-1$
- private static final String CTX_FILES = "files"; //$NON-NLS-1$
- private static final String CTX_TITLE = "title"; //$NON-NLS-1$
- private static final String CTX_COMMENT = "comment"; //$NON-NLS-1$
-
- private String title;
- private String comment;
- private Map dirtyFiles; // Maps IFile->String(revision)
-
-
- /**
- * Restore a commit set from the given memento
- * @param memento the memento to which the set was saved
- * @return the restored set
- */
- public static CommitSet from(IMemento memento) {
- CommitSet set = new CommitSet();
- set.init(memento);
- return set;
- }
-
- private CommitSet() {
- dirtyFiles = new HashMap();
- }
-
- /**
- * Create a commit set with the given title.
- * @param title the title for the commit set
- */
- /* package */ CommitSet(String title) {
- this();
- this.title = title;
- }
-
- /**
- * Get the title of the commit set. The title is used
- * as the comment when the set is committed if no comment
- * has been explicitly set using <code>setComment</code>.
- * @return the title of the set
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Set the title of the set. The title is used
- * as the comment when the set is committed if no comment
- * has been explicitly set using <code>setComment</code>.
- * @param title the title of the set
- */
- public void setTitle(String title) {
- this.title = title;
- CommitSetManager.getInstance().titleChanged(this);
- }
-
- /**
- * Get the comment of this commit set. If the comment
- * as never been set, the title is returned as the comment
- * @return the comment to be used when the set is committed
- */
- public String getComment() {
- if (comment == null) {
- return getTitle();
- }
- return comment;
- }
-
- /**
- * Set the comment to be used when the commit set is committed.
- * If <code>null</code> is passed, the title of the set
- * will be used as the comment.
- * @param comment the comment for the set or <code>null</code>
- * if the title should be the comment
- */
- public void setComment(String comment) {
- if (comment != null && comment.equals(getTitle())) {
- this.comment = null;
- } else {
- this.comment = comment;
- }
- }
-
- /**
- * Add the dirty files in the given array to the commit set.
- * The list of files that were added is returned.
- * @param files the files to be added to the set
- * @return the files that were added because they were dirty
- * @throws CVSException if the dirty state or revision of one of the files could not be determined
- */
- public IFile[] addFiles(IResource[] files) throws CVSException {
- List addedFiles = new ArrayList();
- for (int i = 0; i < files.length; i++) {
- IResource file = files[i];
- if (file.getType() == IResource.FILE && addFile((IFile)file)) {
- addedFiles.add(file);
- }
- }
- IFile[] fileArray = (IFile[]) addedFiles.toArray(new IFile[addedFiles.size()]);
- if (fileArray.length > 0) {
- CommitSetManager.getInstance().filesAdded(this, fileArray);
- }
- return fileArray;
- }
-
- /**
- * Remove the given files from this set.
- * @param files the files to be removed
- */
- public void removeFiles(IFile[] files) {
- List removed = new ArrayList();
- for (int i = 0; i < files.length; i++) {
- IFile file = files[i];
- if (dirtyFiles.remove(file) != null) {
- removed.add(file);
- }
- }
- if (!removed.isEmpty()) {
- CommitSetManager.getInstance().filesChanged(this, (IFile[]) removed.toArray(new IFile[removed.size()]));
- }
- }
-
- private boolean addFile(IFile file) throws CVSException {
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor(file);
- if (!cvsFile.isModified(null)) {
- return false;
- }
- byte[] syncBytes = cvsFile.getSyncBytes();
- String revision;
- if (syncBytes == null) {
- revision = ResourceSyncInfo.ADDED_REVISION;
- } else {
- revision = ResourceSyncInfo.getRevision(syncBytes);
- }
- addFile(file, revision);
- return true;
- }
-
- private boolean isModified(IResource resource) {
- try {
- ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- return cvsResource.isModified(null);
- } catch (CVSException e) {
- CVSUIPlugin.log(e);
- return true;
- }
- }
-
- private void addFile(IFile file, String revision) {
- dirtyFiles.put(file, revision);
- }
-
- private String getRevision(IFile file) {
- return (String)dirtyFiles.get(file);
- }
-
- public void save(IMemento memento) {
- memento.putString(CTX_TITLE, getTitle());
- if (comment != null) {
- memento.putString(CTX_COMMENT, comment);
- }
- for (Iterator iter = dirtyFiles.keySet().iterator(); iter.hasNext();) {
- IFile file = (IFile) iter.next();
- IMemento child = memento.createChild(CTX_FILES);
- child.putString(CTX_PATH, file.getFullPath().toString());
- child.putString(CTX_REVISION, getRevision(file));
- }
- }
-
- public void init(IMemento memento) {
- title = memento.getString(CTX_TITLE);
- comment = memento.getString(CTX_COMMENT);
- IMemento[] children = memento.getChildren(CTX_FILES);
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- for (int i = 0; i < children.length; i++) {
- IMemento child = children[i];
- String path = child.getString(CTX_PATH);
- String revision = child.getString(CTX_REVISION);
- IFile file = root.getFile(new Path(path));
- addFile(file, revision);
- }
- }
-
- /**
- * The given project is no longer under CVS control.
- * Remoev any files that may have been included in the
- * commit set.
- */
- /* package*/ void projectRemoved(IProject project) {
- List filesToRemove = new ArrayList();
- for (Iterator iter = dirtyFiles.keySet().iterator(); iter.hasNext();) {
- IFile file = (IFile) iter.next();
- if (file.getProject().equals(project)) {
- filesToRemove.add(file);
- }
- }
- removeFiles((IFile[]) filesToRemove.toArray(new IFile[filesToRemove.size()]));
- }
-
- /**
- * The sync state of the given resources has changed. If any of them are in this
- * set, adjust the state accordingly.
- * @param changedResources the resources whose sync state has changed
- */
- /* package*/ void resourceSyncInfoChanged(IResource[] changedResources) {
- List filesToRemove = new ArrayList();
- for (int i = 0; i < changedResources.length; i++) {
- IResource resource = changedResources[i];
- if (dirtyFiles.containsKey(resource) && !isModified(resource)) {
- filesToRemove.add(resource);
- }
- }
- removeFiles((IFile[]) filesToRemove.toArray(new IFile[filesToRemove.size()]));
- }
-
- /**
- * Commit the files in this commit set to the repository.
- * @param monitor a progress monitor
- * @throws InterruptedException
- * @throws InvocationTargetException
- */
- public void commit(IWorkbenchPart part, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IFile[] files = getFiles();
- new CommitOperation(part, files, new Command.LocalOption[] { Commit.makeArgumentOption(Command.MESSAGE_OPTION, getComment()) })
- .run(monitor);
- // TODO: Handle set archival
- }
-
- /**
- * Return the dirty files contained in this set.
- * @return the dirty files contained in this set
- */
- public IFile[] getFiles() {
- return (IFile[]) dirtyFiles.keySet().toArray(new IFile[dirtyFiles.size()]);
- }
-
- /**
- * Return whether the set contains any files.
- * @return whether the set contains any files
- */
- public boolean isEmpty() {
- return dirtyFiles.isEmpty();
- }
-
- /**
- * Return true if the given file is included in this set.
- * @param local a ocal file
- * @return true if the given file is included in this set
- */
- public boolean contains(IResource local) {
- return dirtyFiles.containsKey(local);
- }
-
- /**
- * Return whether the set has a comment that differs from the title.
- * @return whether the set has a comment that differs from the title
- */
- public boolean hasComment() {
- return comment != null;
- }
-
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
index 7fa19a77f..62b5ca838 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
@@ -17,14 +17,11 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.change.ChangeSet;
import org.eclipse.team.internal.ccvs.ui.*;
-import org.eclipse.team.internal.ccvs.ui.CommitCommentArea;
import org.eclipse.ui.help.WorkbenchHelp;
/**
@@ -33,7 +30,7 @@ import org.eclipse.ui.help.WorkbenchHelp;
*/
public class CommitSetDialog extends Dialog {
- private final CommitSet set;
+ private final ChangeSet set;
private CommitCommentArea commitCommentArea;
private Text nameText;
private Button useTitleButton;
@@ -42,13 +39,13 @@ public class CommitSetDialog extends Dialog {
private final String description;
private String comment;
- public CommitSetDialog(Shell parentShell, CommitSet set, IResource[] files, String title, String description) {
+ public CommitSetDialog(Shell parentShell, ChangeSet set, IResource[] files, String title, String description) {
super(parentShell);
this.set = set;
this.title = title;
this.description = description;
if (files == null) {
- files = set.getFiles();
+ files = set.getResources();
}
int shellStyle = getShellStyle();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
index ed6858d7b..d50674215 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
@@ -12,6 +12,7 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.team.core.change.ChangeSet;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ui.synchronize.SynchronizeModelElement;
@@ -23,9 +24,9 @@ import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
*/
public class CommitSetDiffNode extends SynchronizeModelElement {
- private final CommitSet set;
+ private final ChangeSet set;
- public CommitSetDiffNode(ISynchronizeModelElement parent, CommitSet set) {
+ public CommitSetDiffNode(ISynchronizeModelElement parent, ChangeSet set) {
super(parent);
this.set = set;
}
@@ -37,7 +38,7 @@ public class CommitSetDiffNode extends SynchronizeModelElement {
return null;
}
- public CommitSet getSet() {
+ public ChangeSet getSet() {
return set;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetManager.java
index 44f78e673..c0117d228 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetManager.java
@@ -10,452 +10,21 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import java.io.*;
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.util.ResourceStateChangeListeners;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.XMLMemento;
+import org.eclipse.team.core.change.SubscriberChangeSetManager;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
/**
* Thsi class keeps the active commit sets up-to-date.
*/
-public class CommitSetManager extends Object implements IResourceChangeListener, IResourceStateChangeListener {
-
- private static final String FILENAME = "commitSets.xml"; //$NON-NLS-1$
- private static final String CTX_COMMIT_SETS = "commitSets"; //$NON-NLS-1$
- private static final String CTX_COMMIT_SET = "commitSet"; //$NON-NLS-1$
- private static final String CTX_DEFAULT_SET = "defaultSet"; //$NON-NLS-1$
-
- private List activeSets;
- private static CommitSetManager instance;
- private static ListenerList listeners = new ListenerList();
- private CommitSet defaultSet;
+public class CommitSetManager {
- /*
- * Property change event for the default set
- */
- public static final String DEFAULT_SET = "DefaultSet"; //$NON-NLS-1$
+ private static SubscriberChangeSetManager instance;
- public synchronized static CommitSetManager getInstance() {
+ public synchronized static SubscriberChangeSetManager getInstance() {
if (instance == null) {
- instance = new CommitSetManager();
+ instance = new SubscriberChangeSetManager(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
}
return instance;
}
- private CommitSetManager() {
- try {
- load();
- } catch (CoreException e) {
- // The saved commit sets could not be restored
- CVSUIPlugin.log(e);
- }
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- ResourceStateChangeListeners.getListener().addResourceStateChangeListener(this);
- }
-
- public void shutdown() {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- ResourceStateChangeListeners.getListener().removeResourceStateChangeListener(this);
- save();
- }
-
- private void load() throws CoreException {
- activeSets = new ArrayList();
- File file = getStateFile();
- Reader reader;
- try {
- reader = new BufferedReader(new FileReader(file));
- } catch (FileNotFoundException e) {
- return;
- }
- IMemento memento = XMLMemento.createReadRoot(reader);
- String defaultSetTitle = memento.getString(CTX_DEFAULT_SET);
- IMemento[] sets = memento.getChildren(CTX_COMMIT_SET);
- for (int i = 0; i < sets.length; i++) {
- IMemento child = sets[i];
- CommitSet set = CommitSet.from(child);
- if (defaultSet == null && defaultSetTitle != null && set.getTitle().equals(defaultSetTitle)) {
- defaultSet = set;
- }
- activeSets.add(set);
- }
- }
-
- private void save() {
- XMLMemento xmlMemento = XMLMemento.createWriteRoot(CTX_COMMIT_SETS);
- for (Iterator it = activeSets.iterator(); it.hasNext(); ) {
- CommitSet set = (CommitSet) it.next();
- if (!set.isEmpty()) {
- IMemento child = xmlMemento.createChild(CTX_COMMIT_SET);
- set.save(child);
- }
- }
- if (defaultSet != null) {
- xmlMemento.putString(CTX_DEFAULT_SET, defaultSet.getTitle());
- }
- try {
- Writer writer = new BufferedWriter(new FileWriter(getStateFile()));
- try {
- xmlMemento.save(writer);
- } finally {
- writer.close();
- }
- } catch (IOException e) {
- TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, "An error occurred saving the commit sets to disk.", e)); //$NON-NLS-1$
- }
- }
-
- private File getStateFile() {
- IPath pluginStateLocation = CVSUIPlugin.getPlugin().getStateLocation();
- return pluginStateLocation.append(FILENAME).toFile(); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- // File modifications should be handled by the resourceModified method.
- // Therefore, we are only concerned with project deletions and close
- processDelta(event.getDelta());
-
- }
-
- private void processDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- int kind = delta.getKind();
-
- if (resource.getType() == IResource.ROOT) {
- IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.REMOVED | IResourceDelta.ADDED);
- for (int i = 0; i < affectedChildren.length; i++) {
- processDelta(affectedChildren[i]);
- }
- return;
- }
-
- if (resource.getType() == IResource.PROJECT) {
- // Handle a deleted project
- if (((kind & IResourceDelta.REMOVED) != 0)) {
- projectDeconfigured((IProject)resource);
- return;
- }
- // Handle a closed project
- if ((delta.getFlags() & IResourceDelta.OPEN) != 0 && !((IProject) resource).isOpen()) {
- projectDeconfigured((IProject)resource);
- return;
- }
- }
- }
-
- private Object[] getListeners() {
- return listeners.getListeners();
- }
-
- /**
- * The title of the given set has changed. Notify any listeners.
- */
- /* package */ void titleChanged(final CommitSet set) {
- if (activeSets.contains(set)) {
- Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ICommitSetChangeListener listener = (ICommitSetChangeListener)listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exceptions are logged by the platform
- }
- public void run() throws Exception {
- listener.titleChanged(set);
- }
- });
- }
- }
- }
-
- /**
- * The state of files in the set have changed.
- */
- /* package */void filesAdded(final CommitSet set, final IFile[] files) {
- filesChanged(set, files);
- // Remove the added files from any other set that contains them
- for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- CommitSet otherSet = (CommitSet) iter.next();
- if (otherSet != set) {
- otherSet.removeFiles(files);
- }
- }
- }
-
- /**
- * The state of files in the set have changed.
- */
- /* package */void filesChanged(final CommitSet set, final IFile[] files) {
- if (activeSets.contains(set)) {
- Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ICommitSetChangeListener listener = (ICommitSetChangeListener) listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exceptions are logged by the platform
- }
- public void run() throws Exception {
- listener.filesChanged(set, files);
- }
- });
- }
- }
- }
-
- private void firePropertyChange(String property, CommitSet oldDefault, CommitSet newDefault) {
- final PropertyChangeEvent event = new PropertyChangeEvent(this, property, oldDefault, newDefault);
- Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ICommitSetChangeListener listener = (ICommitSetChangeListener) listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exceptions are logged by the platform
- }
- public void run() throws Exception {
- listener.propertyChange(event);
- }
- });
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#resourceSyncInfoChanged(org.eclipse.core.resources.IResource[])
- */
- public void resourceSyncInfoChanged(IResource[] changedResources) {
- List toRemove = new ArrayList();
- for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- CommitSet set = (CommitSet) iter.next();
- if (!set.isEmpty()) {
- // Don't forward the event if the set is empty
- set.resourceSyncInfoChanged(changedResources);
- if (set.isEmpty()) {
- toRemove.add(set);
- }
- }
- }
- for (Iterator iter = toRemove.iterator(); iter.hasNext();) {
- CommitSet set = (CommitSet) iter.next();
- remove(set);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#externalSyncInfoChange(org.eclipse.core.resources.IResource[])
- */
- public void externalSyncInfoChange(IResource[] changedResources) {
- resourceSyncInfoChanged(changedResources);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#resourceModified(org.eclipse.core.resources.IResource[])
- */
- public void resourceModified(IResource[] changedResources) {
- // First, remove any clean files from active commit sets
- resourceSyncInfoChanged(changedResources);
- // Next, add any dirty files that are not in an active set to the default set
- if (defaultSet != null) {
- considerForDefaultSet(changedResources);
- }
- }
-
- private void considerForDefaultSet(IResource[] changedResources) {
- List filesToAdd = new ArrayList();
- for (int i = 0; i < changedResources.length; i++) {
- IResource resource = changedResources[i];
- if (isDirtyFile(resource) && !isInActiveSet(resource)) {
- filesToAdd.add(resource);
- }
- }
- if (!filesToAdd.isEmpty()) {
- try {
- defaultSet.addFiles((IFile[]) filesToAdd.toArray(new IFile[filesToAdd.size()]));
- } catch (CVSException e) {
- CVSUIPlugin.log(e);
- }
- }
- }
-
- private boolean isInActiveSet(IResource resource) {
- for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- CommitSet set = (CommitSet) iter.next();
- if (set.contains(resource)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isDirtyFile(IResource resource) {
- try {
- if (resource.getType() != IResource.FILE) return false;
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile)resource);
- return cvsFile.isModified(null);
- } catch (CVSException e) {
- CVSUIPlugin.log(e);
- return true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#projectConfigured(org.eclipse.core.resources.IProject)
- */
- public void projectConfigured(IProject project) {
- if (defaultSet != null) {
- // Need to scan for outgoing changes and add them to the default set
- CVSWorkspaceSubscriber subscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
- // TODO: Should be done in a background job
- SyncInfoSet syncSet = new SyncInfoSet();
- subscriber.collectOutOfSync(new IResource[] { project }, IResource.DEPTH_INFINITE, syncSet, new NullProgressMonitor());
- syncSet.selectNodes(ChangeLogModelProvider.OUTGOING_FILE_FILTER);
- considerForDefaultSet(syncSet.getResources());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#projectDeconfigured(org.eclipse.core.resources.IProject)
- */
- public void projectDeconfigured(IProject project) {
- for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- CommitSet set = (CommitSet) iter.next();
- set.projectRemoved(project);
- }
- }
-
- /**
- * Create a commit set with the given title and files. The created
- * set is not added to the control of the commit set manager
- * so no events are fired. The set can be added using the
- * <code>add</code> method.
- * @param title the title of the commit set
- * @param files the files contained in the set
- * @return the created set
- * @throws CVSException
- */
- public CommitSet createCommitSet(String title, IResource[] files) throws CVSException {
- CommitSet commitSet = new CommitSet(title);
- if (files != null && files.length > 0)
- commitSet.addFiles(files);
- return commitSet;
- }
-
- /**
- * Add the set to the list of active sets.
- * @param set the set to be added
- */
- public void add(final CommitSet set) {
- if (!contains(set)) {
- activeSets.add(set);
- Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ICommitSetChangeListener listener = (ICommitSetChangeListener)listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exceptions are logged by the platform
- }
- public void run() throws Exception {
- listener.setAdded(set);
- }
- });
- }
- }
- }
-
- /**
- * Remove the set from the list of active sets.
- * @param set the set to be removed
- */
- public void remove(final CommitSet set) {
- if (contains(set)) {
- activeSets.remove(set);
- Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ICommitSetChangeListener listener = (ICommitSetChangeListener)listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exceptions are logged by the platform
- }
- public void run() throws Exception {
- listener.setRemoved(set);
- }
- });
- }
- }
- }
-
- /**
- * Return whether the manager contains the given commit set
- * @param set the commit set being tested
- * @return whether the set is contained in the manager's list of active sets
- */
- public boolean contains(CommitSet set) {
- return activeSets.contains(set);
- }
-
- /**
- * Add the listener to the set of registered listeners.
- * @param listener the listener to be added
- */
- public void addListener(ICommitSetChangeListener listener) {
- listeners.add(listener);
- }
-
- /**
- * Remove the listener from the set of registered listeners.
- * @param listener the listener to remove
- */
- public void removeListener(ICommitSetChangeListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * Return the list of active commit sets.
- * @return the list of active commit sets
- */
- public CommitSet[] getSets() {
- return (CommitSet[]) activeSets.toArray(new CommitSet[activeSets.size()]);
- }
-
- /**
- * Make the given set the default set into which all new modifications
- * that ae not already in another set go.
- * @param set the set which is to become the default set
- */
- public void makeDefault(CommitSet set) {
- CommitSet oldDefault = defaultSet;
- defaultSet = set;
- firePropertyChange(DEFAULT_SET, oldDefault, defaultSet);
- }
-
- /**
- * Retrn the set which is currently the default or
- * <code>null</code> if there is no default set.
- * @return
- */
- public CommitSet getDefaultCommitSet() {
- return defaultSet;
- }
- /**
- * Return whether the given set is the default set into which all
- * new modifications will be placed.
- * @param set the set to test
- * @return whether the set is the default set
- */
- public boolean isDefault(CommitSet set) {
- return set == defaultSet;
- }
-
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ICommitSetChangeListener.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ICommitSetChangeListener.java
deleted file mode 100644
index 061369abb..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ICommitSetChangeListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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.ui.subscriber;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * Interface for registering commit set change listeners with
- * the commit set manager.
- */
-public interface ICommitSetChangeListener extends IPropertyChangeListener {
-
- /**
- * The given set has been added to the set manager.
- * @param set the added set
- */
- void setAdded(CommitSet set);
-
- /**
- * The given set has been removed from the set manager.
- * @param set the removed set
- */
- void setRemoved(CommitSet set);
-
- /**
- * The title of the given set has changed.
- * @param set the set whose title changed
- */
- void titleChanged(CommitSet set);
-
- /**
- * The state of the given files have change with respect to the
- * given set. This means that the files have either been added
- * or removed from the set. Callers can use the files contained
- * in the set to determine if each file is an addition or removal.
- * @param set the commit set that has changed
- * @param files the files whose containment state has changed w.r.t the set
- */
- void filesChanged(CommitSet set, IFile[] files);
-
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
index 08bf1b069..59539ae98 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
@@ -22,11 +22,10 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.change.ChangeSet;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Commit;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -268,10 +267,10 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
private String getProposedComment(IResource[] resourcesToCommit) {
StringBuffer comment = new StringBuffer();
- CommitSet[] sets = CommitSetManager.getInstance().getSets();
+ ChangeSet[] sets = CommitSetManager.getInstance().getSets();
int numMatchedSets = 0;
for (int i = 0; i < sets.length; i++) {
- CommitSet set = sets[i];
+ ChangeSet set = sets[i];
if (containsOne(set, resourcesToCommit)) {
if(numMatchedSets > 0) comment.append(System.getProperty("line.separator")); //$NON-NLS-1$
comment.append(set.getComment());
@@ -281,7 +280,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
return comment.toString();
}
- private boolean containsAll(CommitSet set, IResource[] resourcesToCommit) {
+ private boolean containsAll(ChangeSet set, IResource[] resourcesToCommit) {
for (int j = 0; j < resourcesToCommit.length; j++) {
IResource resource = resourcesToCommit[j];
if (!set.contains(resource)) {
@@ -291,7 +290,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
return true;
}
- private boolean containsOne(CommitSet set, IResource[] resourcesToCommit) {
+ private boolean containsOne(ChangeSet set, IResource[] resourcesToCommit) {
for (int j = 0; j < resourcesToCommit.length; j++) {
IResource resource = resourcesToCommit[j];
if (set.contains(resource)) {
diff --git a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch
index ec3eeea25..ec62e07a3 100644
--- a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch
+++ b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch
@@ -1,16 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="clearws" value="true"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.AllTests"/>
+<booleanAttribute key="useProduct" value="false"/>
<booleanAttribute key="tracing" value="false"/>
-<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
-<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="clearConfig" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<mapAttribute key="tracingOptions">
<mapEntry key="org.eclipse.core.boot/monitor/classes" value="false"/>
@@ -59,19 +55,19 @@
<mapEntry key="org.eclipse.help.ui/debug/ieadapter/inprocess" value="false"/>
<mapEntry key="org.eclipse.jface/trace/actions" value="false"/>
<mapEntry key="org.eclipse.core.runtime/registry/debug/events/extension" value="false"/>
-<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/>
<mapEntry key="org.eclipse.help.webapp/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/>
<mapEntry key="org.eclipse.team.cvs.core/debug" value="true"/>
<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/>
<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/>
<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/>
<mapEntry key="org.eclipse.core.resources/save" value="false"/>
-<mapEntry key="org.eclipse.update.core/debug/install" value="false"/>
<mapEntry key="org.eclipse.ui/debug/internalerror/openDialog" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/install" value="false"/>
<mapEntry key="org.eclipse.core.resources/debug" value="false"/>
<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/>
-<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/>
<mapEntry key="org.eclipse.core.boot/trace/filters" value="trace.properties"/>
+<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/>
<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/>
<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/>
<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/>
@@ -81,15 +77,15 @@
<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/resource" value="*"/>
<mapEntry key="org.eclipse.team.ftp/list" value="true"/>
-<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/>
<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/>
<mapEntry key="org.eclipse.core.resources/monitor/builders" value="false"/>
<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/>
<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/>
-<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/>
-<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
<mapEntry key="org.eclipse.ui/trace/workbench.restore" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/>
<mapEntry key="org.eclipse.ui/trace/part.create" value="false"/>
<mapEntry key="org.eclipse.help/debug/protocols" value="false"/>
<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/>
@@ -97,13 +93,13 @@
<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/native" value="*"/>
<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/>
-<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/properties" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/create" value="false"/>
<mapEntry key="org.eclipse.core.runtime/jobs/beginend" value="false"/>
<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/>
-<mapEntry key="org.eclipse.team.ftp/responses" value="true"/>
<mapEntry key="org.eclipse.team.core/debug" value="false"/>
+<mapEntry key="org.eclipse.team.ftp/responses" value="true"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/success" value="false"/>
<mapEntry key="org.eclipse.core.runtime/jobs" value="false"/>
<mapEntry key="org.eclipse.core.boot/monitor/plugins" value="false"/>
@@ -129,8 +125,8 @@
<mapEntry key="org.eclipse.core.runtime/config/debug" value="false"/>
<mapEntry key="org.eclipse.help.ui/debug" value="true"/>
<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/>
-<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/>
<mapEntry key="org.eclipse.debug.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/>
<mapEntry key="org.eclipse.jdt.debug/debug" value="true"/>
<mapEntry key="org.eclipse.core.runtime/debug" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/>
@@ -142,12 +138,21 @@
<mapEntry key="org.eclipse.core.runtime/jobs/timing" value="false"/>
<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/failure" value="false"/>
</mapAttribute>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="includeFragments" value="false"/>
+<booleanAttribute key="clearws" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.AllTests"/>
+<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
+<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="onePluginID" value=""/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
<stringAttribute key="progargs" value="-os win32 -ws win32 -arch x86 -nl en_CA"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/>
<booleanAttribute key="askclear" value="false"/>
<booleanAttribute key="onePlugin" value="false"/>
diff --git a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
index abc381468..b00b64999 100644
--- a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
+++ b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="clearws" value="true"/>
<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.subscriber.CVSMergeSubscriberTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.ui.CommitSetTests"/>
+<booleanAttribute key="useProduct" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
-<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName=testIncomingChanges"/>
+<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testIncomingChanges"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="clearConfig" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
@@ -15,8 +17,11 @@
<stringAttribute key="onePluginID" value=""/>
<stringAttribute key="progargs" value="-os win32 -ws win32 -arch x86 -nl en_CA"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<booleanAttribute key="automaticAdd" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/>
<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="includeFragments" value="false"/>
<booleanAttribute key="onePlugin" value="false"/>
<stringAttribute key="location0" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java
index ee2249201..09af1d649 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java
@@ -11,20 +11,17 @@
package org.eclipse.team.tests.ccvs.ui;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import junit.framework.Test;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.change.*;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.ui.subscriber.*;
-import org.eclipse.team.internal.ccvs.ui.subscriber.CommitSet;
import org.eclipse.team.internal.ccvs.ui.subscriber.CommitSetManager;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
@@ -35,22 +32,22 @@ public class CommitSetTests extends EclipseTest {
private List addedSets = new ArrayList();
private List removedSets = new ArrayList();
- private ICommitSetChangeListener listener = new ICommitSetChangeListener() {
- public void setAdded(CommitSet set) {
+ private IChangeSetChangeListener listener = new IChangeSetChangeListener() {
+ public void setAdded(ChangeSet set) {
addedSets.add(set);
}
- public void setRemoved(CommitSet set) {
+ public void setRemoved(ChangeSet set) {
removedSets.add(set);
}
- public void titleChanged(CommitSet set) {
+ public void titleChanged(ChangeSet set) {
// TODO Auto-generated method stub
}
- public void filesChanged(CommitSet set, IFile[] files) {
+ public void defaultSetChanged(ChangeSet set) {
// TODO Auto-generated method stub
-
+
}
- public void propertyChange(PropertyChangeEvent event) {
+ public void resourcesChanged(ChangeSet set, IResource[] resources) {
// TODO Auto-generated method stub
}
@@ -75,11 +72,11 @@ public class CommitSetTests extends EclipseTest {
* @return the newly create commit set
* @throws TeamException
*/
- protected CommitSet createCommitSet(String title, IFile[] files, boolean manageSet) throws TeamException {
+ protected ChangeSet createCommitSet(String title, IFile[] files, boolean manageSet) throws TeamException {
assertIsModified(getName(), files);
- CommitSetManager manager = CommitSetManager.getInstance();
- CommitSet set = manager.createCommitSet(title, files);
- assertEquals("Not all files were asdded to the set", files.length, set.getFiles().length);
+ SubscriberChangeSetManager manager = CommitSetManager.getInstance();
+ ChangeSet set = manager.createSet(title, files);
+ assertEquals("Not all files were asdded to the set", files.length, set.getResources().length);
if (manageSet) {
manager.add(set);
waitForSetAddedEvent(set);
@@ -94,26 +91,20 @@ public class CommitSetTests extends EclipseTest {
* @param set the commit set
* @throws CVSException
*/
- protected void commit(CommitSet set) throws CVSException {
+ protected void commit(ChangeSet set) throws CoreException {
boolean isManaged = setIsManaged(set);
- try {
- set.commit(null /* no workbench part */, DEFAULT_MONITOR);
- } catch (InvocationTargetException e) {
- throw CVSException.wrapException(e);
- } catch (InterruptedException e) {
- fail("The commit was interupted");
- }
+ commitResources(set.getResources(), IResource.DEPTH_ZERO);
if (isManaged) {
// Committing the set should remove it from the manager
waitForSetRemovedEvent(set);
}
}
- private boolean setIsManaged(CommitSet set) {
+ private boolean setIsManaged(ChangeSet set) {
return CommitSetManager.getInstance().contains(set);
}
- private void waitForSetAddedEvent(CommitSet set) {
+ private void waitForSetAddedEvent(ChangeSet set) {
int count = 0;
while (count < 5) {
if (addedSets.contains(set)) {
@@ -130,7 +121,7 @@ public class CommitSetTests extends EclipseTest {
fail("Did not receive expected set added event");
}
- private void waitForSetRemovedEvent(CommitSet set) {
+ private void waitForSetRemovedEvent(ChangeSet set) {
int count = 0;
while (count < 5) {
if (removedSets.contains(set)) {
@@ -138,6 +129,7 @@ public class CommitSetTests extends EclipseTest {
return;
}
try {
+ while (Display.getCurrent().readAndDispatch()) {}
Thread.sleep(1000);
} catch (InterruptedException e) {
// keep going
@@ -179,7 +171,7 @@ public class CommitSetTests extends EclipseTest {
project.getFile("changed.txt"),
project.getFile("deleted.txt"),
project.getFile("added.txt")};
- CommitSet set = createCommitSet("testSimpleCommit", files, false /* do not manage the set */);
+ ChangeSet set = createCommitSet("testSimpleCommit", files, false /* do not manage the set */);
commit(set);
assertLocalStateEqualsRemote(project);
}
@@ -201,7 +193,7 @@ public class CommitSetTests extends EclipseTest {
project.getFile("changed.txt"),
project.getFile("deleted.txt"),
project.getFile("added.txt")};
- CommitSet set = createCommitSet("testSimpleCommit", files, true /* manage the set */);
+ ChangeSet set = createCommitSet("testSimpleCommit", files, true /* manage the set */);
commit(set);
assertLocalStateEqualsRemote(project);
}

Back to the top