Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-27 20:31:26 +0000
committerMichael Valenta2004-09-27 20:31:26 +0000
commit02408805bc37eb6654c10cb61612c0c60b6a3c0c (patch)
treebbb6469e6d95e242c439504c4858aafd218b6daa
parent6a479d8079e8878d53b8f4fe0806661619cf3bd2 (diff)
downloadeclipse.platform.team-02408805bc37eb6654c10cb61612c0c60b6a3c0c.tar.gz
eclipse.platform.team-02408805bc37eb6654c10cb61612c0c60b6a3c0c.tar.xz
eclipse.platform.team-02408805bc37eb6654c10cb61612c0c60b6a3c0c.zip
Ongoing refactoring of Change Sets
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ActiveChangeSet.java183
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ChangeSet.java281
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java47
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/IChangeSetChangeListener.java10
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetManager.java84
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java304
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelSorter.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java1
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/obj/changeset_obj.gifbin0 -> 596 bytes
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ITeamUIImages.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetDiffNode.java (renamed from bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java)21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetManagementActionGroup.java278
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java12
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java26
21 files changed, 805 insertions, 526 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ActiveChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ActiveChangeSet.java
new file mode 100644
index 000000000..57dc1a4f7
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ActiveChangeSet.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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.subscribers;
+
+import java.util.*;
+
+import org.eclipse.core.resources.*;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.internal.core.TeamPlugin;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * An active change set represents a set of local resource changes
+ * that are grouped together as a single logical change.
+ * @since 3.1
+ */
+public class ActiveChangeSet extends 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$
+
+ 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 ActiveChangeSet(SubscriberChangeSetManager manager, String title) {
+ super(title);
+ this.manager = manager;
+ }
+
+ /**
+ * 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 getName();
+ }
+
+ /**
+ * 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) {
+ setName(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;
+ }
+ }
+
+ /*
+ * Override inherited method to only include outgoing changes
+ */
+ protected boolean isValidChange(SyncInfo info) {
+ return getManager().isModified(info);
+ }
+
+ private void addResource(IResource resource) throws TeamException {
+ Subscriber subscriber = getManager().getSubscriber();
+ SyncInfo info = subscriber.getSyncInfo(resource);
+ if (info != null) {
+ add(info);
+ }
+ }
+
+ private SubscriberChangeSetManager getManager() {
+ return manager;
+ }
+
+ /**
+ * 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;
+ }
+
+ public void save(Preferences prefs) {
+ prefs.put(CTX_TITLE, getTitle());
+ if (comment != null) {
+ prefs.put(CTX_COMMENT, comment);
+ }
+ if (!isEmpty()) {
+ StringBuffer buffer = new StringBuffer();
+ IResource[] resources = getResources();
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ buffer.append(resource.getFullPath().toString());
+ buffer.append('\n');
+ }
+ prefs.put(CTX_RESOURCES, buffer.toString());
+ }
+ }
+
+ public void init(Preferences prefs) {
+ setName(prefs.get(CTX_TITLE, "")); //$NON-NLS-1$
+ comment = prefs.get(CTX_COMMENT, null);
+ String resourcePaths = prefs.get(CTX_RESOURCES, null);
+ if (resourcePaths != null) {
+ try {
+ getSyncInfoSet().beginInput();
+ 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);
+ }
+ }
+ }
+ }
+ } finally {
+ getSyncInfoSet().endInput(null);
+ }
+ }
+ }
+
+ /**
+ * Add the resources to the change set if they are outgoing changes.
+ * @param resources the resouces to add.
+ * @throws TeamException
+ */
+ public void add(IResource[] resources) throws TeamException {
+ List toAdd = new ArrayList();
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ SyncInfo info = manager.getSyncInfo(resource);
+ if (info != null) {
+ toAdd.add(info);
+ }
+ }
+ if (!toAdd.isEmpty()) {
+ add((SyncInfo[]) toAdd.toArray(new SyncInfo[toAdd.size()]));
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ChangeSet.java
index 3cbf975ba..6016af6e6 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ChangeSet.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ChangeSet.java
@@ -10,133 +10,71 @@
*******************************************************************************/
package org.eclipse.team.core.subscribers;
-import java.util.*;
-
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoTree;
-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.
+ * A change set represents a set of changes that are logically
+ * grouped together as a single change. The changes are
+ * represented usign a set of <code>SyncInfo</code>.
+ *
+ * @since 3.1
*/
-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$
-
- SyncInfoTree set = new SyncInfoTree();
- 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;
- }
+public abstract class ChangeSet {
- /**
- * 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;
- }
+ private String name;
+ private SyncInfoTree set = new SyncInfoTree();
+
/**
- * 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
+ * Create a change set with no name. Subclasses
+ * that create a change set in this manner should
+ * provide a name before the set is used by other clients.
*/
- public void setTitle(String title) {
- this.title = title;
- getManager().titleChanged(this);
+ protected ChangeSet() {
+ super();
}
/**
- * 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
+ * Create a change set with the given name.
*/
- public String getComment() {
- if (comment == null) {
- return getTitle();
- }
- return comment;
+ public ChangeSet(String name) {
+ this.name = name;
}
/**
- * 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
+ * Return the SyncInfoSet that contains the resources that belong to this change set.
+ * @return the SyncInfoSet that contains the resources that belong to this change set
*/
- public void setComment(String comment) {
- if (comment != null && comment.equals(getTitle())) {
- this.comment = null;
- } else {
- this.comment = comment;
- }
- }
-
- /**
- * Return the SyncInfoSet that contains the resources
- * that belong to this change set.
- * @return the SyncInfoSet that contains the resources
- * that belong to this change set
- */
- public SyncInfoTree getSyncInfos() {
+ public SyncInfoTree getSyncInfoSet() {
return set;
}
-
+
/**
- * Remove the resource from the set.
- * @param resource the resource to be removed
+ * Return the resources that are contained in this set.
+ * @return the resources that are contained in this set
*/
- public void remove(IResource resource) {
- if (contains(resource)) {
- set.remove(resource);
- }
+ public IResource[] getResources() {
+ return set.getResources();
}
/**
- * Remove the resources from the set.
- * @param resources the resources to be removed
+ * Return whether the set contains any files.
+ * @return whether the set contains any files
*/
- public void remove(IResource[] resources) {
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- remove(resource);
- }
+ public boolean isEmpty() {
+ return set.isEmpty();
}
/**
- * The given resource was removed. Ensure that it and
- * any descendants are also removed.
+ * 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 void rootRemoved(IResource root) {
- SyncInfo[] infos = set.getSyncInfos(root, IResource.DEPTH_INFINITE);
- if (infos.length > 0) {
- IResource[] resources = new IResource[infos.length];
- for (int i = 0; i < resources.length; i++) {
- resources[i] = infos[i].getLocal();
- }
- set.removeAll(resources);
- }
+ public boolean contains(IResource local) {
+ return set.getSyncInfo(local) != null;
}
/**
@@ -146,12 +84,23 @@ public class ChangeSet {
* @throws TeamException
*/
public void add(SyncInfo info) {
- if (getManager().isModified(info)) {
+ if (isValidChange(info)) {
set.add(info);
}
}
/**
+ * Return whether the given sync info is a valid change
+ * and can be included in this set. This method is used
+ * by the <code>add</code> method to filter set additions.
+ * @param info a sync info
+ * @return whether the sync info is a valid member of this set
+ */
+ protected boolean isValidChange(SyncInfo info) {
+ return (info != null);
+ }
+
+ /**
* Add the resources to this set if they are modified
* w.r.t. the subscriber.
* @param resources the resources to be added.
@@ -168,113 +117,67 @@ public class ChangeSet {
set.endInput(null);
}
}
-
- private void addResource(IResource resource) throws TeamException {
- Subscriber subscriber = getManager().getSubscriber();
- SyncInfo info = subscriber.getSyncInfo(resource);
- if (info != null) {
- add(info);
- }
- }
-
- private SubscriberChangeSetManager getManager() {
- return manager;
- }
-
+
/**
- * Return whether the set contains any files.
- * @return whether the set contains any files
+ * Remove the resource from the set.
+ * @param resource the resource to be removed
*/
- public boolean isEmpty() {
- return set.isEmpty();
+ public void remove(IResource resource) {
+ if (contains(resource)) {
+ set.remove(resource);
+ }
}
-
+
/**
- * 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
+ * Remove the resources from the set.
+ * @param resources the resources to be removed
*/
- public boolean contains(IResource local) {
- return set.getSyncInfo(local) != null;
+ public void remove(IResource[] resources) {
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ remove(resource);
+ }
}
-
+
/**
- * Return whether the set has a comment that differs from the title.
- * @return whether the set has a comment that differs from the title
+ * Remove the resource and it's descendants to the given depth.
+ * @param resource the resource to be removed
+ * @param depth the depth of the removal (one of
+ * <code>IResource.DEPTH_ZERO, IResource.DEPTH_ONE, IResource.DEPTH_INFINITE)</code>
*/
- public boolean hasComment() {
- return comment != null;
+ public void rootRemoved(IResource resource, int depth) {
+ SyncInfo[] infos = set.getSyncInfos(resource, depth);
+ if (infos.length > 0) {
+ IResource[] resources = new IResource[infos.length];
+ for (int i = 0; i < resources.length; i++) {
+ resources[i] = infos[i].getLocal();
+ }
+ set.removeAll(resources);
+ }
}
/**
- * Return the resources that are contained in this set.
- * @return the resources that are contained in this set
+ * Return a comment describing the change.
+ * @return a comment describing the change
*/
- public IResource[] getResources() {
- return set.getResources();
- }
-
- public void save(Preferences prefs) {
- prefs.put(CTX_TITLE, getTitle());
- if (comment != null) {
- prefs.put(CTX_COMMENT, comment);
- }
- if (!isEmpty()) {
- StringBuffer buffer = new StringBuffer();
- IResource[] resources = set.getResources();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- buffer.append(resource.getFullPath().toString());
- buffer.append('\n');
- }
- prefs.put(CTX_RESOURCES, buffer.toString());
- }
- }
+ public abstract String getComment();
- 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) {
- try {
- getSyncInfos().beginInput();
- 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);
- }
- }
- }
- }
- } finally {
- getSyncInfos().endInput(null);
- }
- }
+ /**
+ * Return the name assigned to this set. The name should be
+ * unique.
+ * @return the name assigned to this set
+ */
+ public String getName() {
+ return name;
}
/**
- * Add the resources to the change set if they are outgoing changes.
- * @param resources the resouces to add.
- * @throws TeamException
+ * Set the name of the change set. The name of a change
+ * set can be changed but it is up to subclass to notify
+ * any interested partied of the name change.
+ * @param name the new name for the set
*/
- public void add(IResource[] resources) throws TeamException {
- List toAdd = new ArrayList();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- SyncInfo info = manager.getSyncInfo(resource);
- if (info != null) {
- toAdd.add(info);
- }
- }
- if (!toAdd.isEmpty()) {
- add((SyncInfo[]) toAdd.toArray(new SyncInfo[toAdd.size()]));
- }
+ protected void setName(String name) {
+ this.name = name;
}
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java
new file mode 100644
index 000000000..edf7e1de1
--- /dev/null
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/CheckedInChangeSet.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.subscribers;
+
+import java.util.Date;
+
+/**
+ * A checked-in change set represents a group of resource
+ * changes that were previously checked into a repository
+ * as a single logical change.
+ * <p>
+ * A previously checked-in set of changes may not apply directly
+ * to the local versions of the resources involved. However,
+ * a <code>SyncInfo</code> is still used to reprsent each change.
+ * The base and remote slots of the <code>SyncInfo</code> identify
+ * the state before and after the resources were checked-in.
+ * @since 3.1
+ */
+public class CheckedInChangeSet extends ChangeSet {
+
+ private String comment;
+ private String author;
+ private Date date;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.ChangeSet#getComment()
+ */
+ public String getComment() {
+ return comment;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/IChangeSetChangeListener.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/IChangeSetChangeListener.java
index ef705805b..0d9012d66 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/IChangeSetChangeListener.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/IChangeSetChangeListener.java
@@ -23,7 +23,7 @@ public interface IChangeSetChangeListener {
* The given set has been added to the set manager.
* @param set the added set
*/
- void setAdded(ChangeSet set);
+ void setAdded(ActiveChangeSet set);
/**
* The default change set has change to be the given set.
@@ -31,19 +31,19 @@ public interface IChangeSetChangeListener {
* set.
* @param set the default set
*/
- void defaultSetChanged(ChangeSet previousDefault, ChangeSet set);
+ void defaultSetChanged(ActiveChangeSet previousDefault, ActiveChangeSet set);
/**
* The given set has been removed from the set manager.
* @param set the removed set
*/
- void setRemoved(ChangeSet set);
+ void setRemoved(ActiveChangeSet set);
/**
* The title of the given set has changed.
* @param set the set whose title changed
*/
- void titleChanged(ChangeSet set);
+ void titleChanged(ActiveChangeSet set);
/**
* The state of the given resources have change with respect to the
@@ -53,6 +53,6 @@ public interface IChangeSetChangeListener {
* @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);
+ void resourcesChanged(ActiveChangeSet set, IResource[] resources);
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetManager.java
index 800434168..6da1a62ac 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetManager.java
@@ -38,7 +38,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
private List activeSets;
private ListenerList listeners = new ListenerList();
- private ChangeSet defaultSet;
+ private ActiveChangeSet defaultSet;
private EventHandler handler;
/*
@@ -94,17 +94,17 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
private void beginDispath() {
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
- set.getSyncInfos().beginInput();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
+ set.getSyncInfoSet().beginInput();
}
}
private void endDispatch(IProgressMonitor monitor) {
monitor.beginTask(null, 100 * activeSets.size());
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
try {
- set.getSyncInfos().endInput(Policy.subMonitorFor(monitor, 100));
+ set.getSyncInfoSet().endInput(Policy.subMonitorFor(monitor, 100));
} catch (RuntimeException e) {
// Don't worry about ending every set if an error occurs.
// Instead, log the error and suggest a restart.
@@ -128,11 +128,11 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
*/
private void handleRemove(IResource resource) {
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
// This will remove any descendants from the set and callback to
// resourcesChanged which will batch changes
if (!set.isEmpty()) {
- set.rootRemoved(resource);
+ set.rootRemoved(resource, IResource.DEPTH_INFINITE);
if (set.isEmpty()) {
remove(set);
}
@@ -146,7 +146,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
private void handleChange(IResource resource, int depth) throws TeamException {
SyncInfo syncInfo = getSyncInfo(resource);
if (isModified(syncInfo)) {
- ChangeSet[] containingSets = getContainingSets(resource);
+ ActiveChangeSet[] containingSets = getContainingSets(resource);
if (containingSets.length == 0) {
// Consider for inclusion in the default set
// if the resource is not already a memebr of another set
@@ -155,9 +155,9 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
} else {
for (int i = 0; i < containingSets.length; i++) {
- ChangeSet set = containingSets[i];
+ ActiveChangeSet set = containingSets[i];
// Update the sync info in the set
- set.getSyncInfos().add(syncInfo);
+ set.getSyncInfoSet().add(syncInfo);
}
}
} else {
@@ -175,7 +175,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
private void removeFromAllSets(IResource resource) {
List toRemove = new ArrayList();
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
if (set.contains(resource)) {
set.remove(resource);
if (set.isEmpty()) {
@@ -184,20 +184,20 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
}
for (Iterator iter = toRemove.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
remove(set);
}
}
- private ChangeSet[] getContainingSets(IResource resource) {
+ private ActiveChangeSet[] getContainingSets(IResource resource) {
Set sets = new HashSet();
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet set = (ChangeSet) iter.next();
+ ActiveChangeSet set = (ActiveChangeSet) iter.next();
if (set.contains(resource)) {
sets.add(set);
}
}
- return (ChangeSet[]) sets.toArray(new ChangeSet[sets.size()]);
+ return (ActiveChangeSet[]) sets.toArray(new ActiveChangeSet[sets.size()]);
}
}
@@ -228,7 +228,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
/**
* The title of the given set has changed. Notify any listeners.
*/
- /* package */ void titleChanged(final ChangeSet set) {
+ /* package */ void titleChanged(final ActiveChangeSet set) {
if (activeSets.contains(set)) {
Object[] listeners = getListeners();
for (int i = 0; i < listeners.length; i++) {
@@ -266,8 +266,8 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @return the created set
* @throws CVSException
*/
- public ChangeSet createSet(String title, SyncInfo[] infos) throws TeamException {
- ChangeSet commitSet = new ChangeSet(this, title);
+ public ActiveChangeSet createSet(String title, SyncInfo[] infos) {
+ ActiveChangeSet commitSet = new ActiveChangeSet(this, title);
if (infos != null && infos.length > 0) {
commitSet.add(infos);
}
@@ -282,7 +282,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @return the created set
* @throws TeamException
*/
- public ChangeSet createSet(String title, IFile[] files) throws TeamException {
+ public ActiveChangeSet createSet(String title, IFile[] files) throws TeamException {
List infos = new ArrayList();
for (int i = 0; i < files.length; i++) {
IFile file = files[i];
@@ -298,10 +298,10 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* Add the set to the list of active sets.
* @param set the set to be added
*/
- public void add(final ChangeSet set) {
+ public void add(final ActiveChangeSet set) {
if (!contains(set)) {
activeSets.add(set);
- set.getSyncInfos().addSyncSetChangedListener(this);
+ set.getSyncInfoSet().addSyncSetChangedListener(this);
Object[] listeners = getListeners();
for (int i = 0; i < listeners.length; i++) {
final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
@@ -314,7 +314,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
});
}
- handleAddedResources(set, set.getSyncInfos().getSyncInfos());
+ handleAddedResources(set, set.getSyncInfoSet().getSyncInfos());
}
}
@@ -322,9 +322,9 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* Remove the set from the list of active sets.
* @param set the set to be removed
*/
- public void remove(final ChangeSet set) {
+ public void remove(final ActiveChangeSet set) {
if (contains(set)) {
- set.getSyncInfos().removeSyncSetChangedListener(this);
+ set.getSyncInfoSet().removeSyncSetChangedListener(this);
activeSets.remove(set);
Object[] listeners = getListeners();
for (int i = 0; i < listeners.length; i++) {
@@ -346,7 +346,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @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) {
+ public boolean contains(ActiveChangeSet set) {
return activeSets.contains(set);
}
@@ -370,8 +370,8 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* 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()]);
+ public ActiveChangeSet[] getSets() {
+ return (ActiveChangeSet[]) activeSets.toArray(new ActiveChangeSet[activeSets.size()]);
}
/**
@@ -379,12 +379,12 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* that ae not already in another set go.
* @param set the set which is to become the default set
*/
- public void makeDefault(ChangeSet set) {
+ public void makeDefault(ActiveChangeSet set) {
// The default set must be an active set
if (!contains(set)) {
add(set);
}
- final ChangeSet oldSet = defaultSet;
+ final ActiveChangeSet oldSet = defaultSet;
defaultSet = set;
Object[] listeners = getListeners();
for (int i = 0; i < listeners.length; i++) {
@@ -405,7 +405,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* <code>null</code> if there is no default set.
* @return
*/
- public ChangeSet getDefaultSet() {
+ public ActiveChangeSet getDefaultSet() {
return defaultSet;
}
/**
@@ -414,7 +414,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @param set the set to test
* @return whether the set is the default set
*/
- public boolean isDefault(ChangeSet set) {
+ public boolean isDefault(ActiveChangeSet set) {
return set == defaultSet;
}
@@ -455,7 +455,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
private void save() {
Preferences prefs = getPreferences();
for (Iterator it = activeSets.iterator(); it.hasNext(); ) {
- ChangeSet set = (ChangeSet) it.next();
+ ActiveChangeSet set = (ActiveChangeSet) it.next();
if (!set.isEmpty()) {
Preferences child = prefs.node(set.getTitle());
set.save(child);
@@ -480,7 +480,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
for (int i = 0; i < childNames.length; i++) {
String string = childNames[i];
Preferences childPrefs = prefs.node(string);
- ChangeSet set = createSet(string, childPrefs);
+ ActiveChangeSet set = createSet(string, childPrefs);
if (defaultSet == null && defaultSetTitle != null && set.getTitle().equals(defaultSetTitle)) {
defaultSet = set;
}
@@ -497,8 +497,8 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @param childPrefs the previously saved preferences
* @return the created change set
*/
- protected ChangeSet createSet(String title, Preferences childPrefs) {
- ChangeSet changeSet = new ChangeSet(this, title);
+ protected ActiveChangeSet createSet(String title, Preferences childPrefs) {
+ ActiveChangeSet changeSet = new ActiveChangeSet(this, title);
changeSet.init(childPrefs);
return changeSet;
}
@@ -557,7 +557,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
return (IResource[]) allResources.toArray(new IResource[allResources.size()]);
}
- private void handleAddedResources(ChangeSet set, SyncInfo[] infos) {
+ private void handleAddedResources(ActiveChangeSet set, SyncInfo[] infos) {
if (isSingleSetPerResource()) {
IResource[] resources = new IResource[infos.length];
for (int i = 0; i < infos.length; i++) {
@@ -565,7 +565,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
// Remove the added files from any other set that contains them
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet otherSet = (ChangeSet) iter.next();
+ ActiveChangeSet otherSet = (ActiveChangeSet) iter.next();
if (otherSet != set) {
otherSet.remove(resources);
}
@@ -574,7 +574,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
private void handleSyncSetChange(SyncInfoSet set, SyncInfo[] addedInfos, IResource[] allAffectedResources) {
- ChangeSet changeSet = getChangeSet(set);
+ ActiveChangeSet changeSet = getChangeSet(set);
if (set.isEmpty() && changeSet != null) {
remove(changeSet);
}
@@ -586,7 +586,7 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
* @param changeSet
* @param allAffectedResources
*/
- private void fireResourcesChangedEvent(final ChangeSet changeSet, final IResource[] allAffectedResources) {
+ private void fireResourcesChangedEvent(final ActiveChangeSet changeSet, final IResource[] allAffectedResources) {
Object[] listeners = getListeners();
for (int i = 0; i < listeners.length; i++) {
final IChangeSetChangeListener listener = (IChangeSetChangeListener)listeners[i];
@@ -601,10 +601,10 @@ public class SubscriberChangeSetManager extends SubscriberResourceCollector impl
}
}
- private ChangeSet getChangeSet(SyncInfoSet set) {
+ private ActiveChangeSet getChangeSet(SyncInfoSet set) {
for (Iterator iter = activeSets.iterator(); iter.hasNext();) {
- ChangeSet changeSet = (ChangeSet) iter.next();
- if (changeSet.getSyncInfos() == set) {
+ ActiveChangeSet changeSet = (ActiveChangeSet) iter.next();
+ if (changeSet.getSyncInfoSet() == set) {
return changeSet;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
index 266799ce5..3c1238db2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipant.java
@@ -37,6 +37,7 @@ public class CVSParticipant extends SubscriberParticipant {
// The decorator adds itself to the configuration
ILabelDecorator labelDecorator = new CVSParticipantLabelDecorator(configuration);
configuration.addLabelDecorator(labelDecorator);
+ configuration.setProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER, CommitSetManager.getInstance());
}
/* (non-Javadoc)
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 e3c32433d..9f2ba7b57 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
@@ -17,7 +17,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.*;
-import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -25,6 +25,7 @@ import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
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.ChangeSetDiffNode;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
@@ -65,8 +66,8 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
return output.toString();
}
}
- if (element instanceof CommitSetDiffNode) {
- ChangeSet set = ((CommitSetDiffNode)element).getSet();
+ if (element instanceof ChangeSetDiffNode) {
+ ActiveChangeSet set = (ActiveChangeSet)((ChangeSetDiffNode)element).getSet();
if (CommitSetManager.getInstance().isDefault(set)) {
text = Policy.bind("CommitSetDiffNode.0", text); //$NON-NLS-1$
}
@@ -134,8 +135,8 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
}
public Font decorateFont(Object element) {
- if (element instanceof CommitSetDiffNode) {
- ChangeSet set = ((CommitSetDiffNode)element).getSet();
+ if (element instanceof ChangeSetDiffNode) {
+ ActiveChangeSet set = (ActiveChangeSet)((ChangeSetDiffNode)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 2626ac7ef..2285390c6 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
@@ -19,7 +19,8 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -30,7 +31,6 @@ import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.*;
import org.eclipse.team.core.variants.IResourceVariant;
@@ -49,7 +49,6 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.eclipse.ui.progress.UIJob;
/**
@@ -85,18 +84,8 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private ViewerSorter embeddedSorter;
// Constants for persisting sorting options
- private final static String COMMIT_SET_GROUP = "commit_set"; //$NON-NLS-1$
private static final String P_LAST_COMMENTSORT = TeamUIPlugin.ID + ".P_LAST_COMMENT_SORT"; //$NON-NLS-1$
- public static final AndSyncInfoFilter OUTGOING_FILE_FILTER = new AndSyncInfoFilter(new FastSyncInfoFilter[] {
- new FastSyncInfoFilter() {
- public boolean select(SyncInfo info) {
- return info.getLocal().getType() == IResource.FILE;
- }
- },
- new SyncInfoDirectionFilter(new int[] { SyncInfo.OUTGOING, SyncInfo.CONFLICTING })
- });
-
/* *****************************************************************************
* Action that allows changing the model providers sort order.
*/
@@ -130,153 +119,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
}
- private class CreateCommitSetAction extends SynchronizeModelAction {
-
- public CreateCommitSetAction(ISynchronizePageConfiguration configuration) {
- super(Policy.bind("ChangeLogModelProvider.0"), configuration); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#needsToSaveDirtyEditors()
- */
- protected boolean needsToSaveDirtyEditors() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
- */
- protected FastSyncInfoFilter getSyncInfoFilter() {
- return OUTGOING_FILE_FILTER;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSubscriberOperation(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration, org.eclipse.compare.structuremergeviewer.IDiffElement[])
- */
- protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
- return new SynchronizeModelOperation(configuration, elements) {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- syncExec(new Runnable() {
- public void run() {
- try {
- IResource[] resources = Utils.getResources(getSelectedDiffElements());
- ChangeSet set = CommitSetManager.getInstance().createSet(Policy.bind("ChangeLogModelProvider.1"), new SyncInfo[0]); //$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.add(resources);
- CommitSetManager.getInstance().add(set);
- } catch (TeamException e) {
- CVSUIPlugin.openError(getConfiguration().getSite().getShell(),
- Policy.bind("ChangeLogModelProvider.4a"), Policy.bind("ChangeLogModelProvider.5a"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- });
- }
- };
- }
- }
-
- private abstract class CommitSetAction extends BaseSelectionListenerAction {
- private final ISynchronizePageConfiguration configuration;
-
- public CommitSetAction(String title, ISynchronizePageConfiguration configuration) {
- super(title);
- this.configuration = configuration;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- return getSelectedSet() != null;
- }
-
- protected ChangeSet getSelectedSet() {
- IStructuredSelection selection = getStructuredSelection();
- if (selection.size() == 1) {
- Object first = selection.getFirstElement();
- if (first instanceof CommitSetDiffNode) {
- return ((CommitSetDiffNode)first).getSet();
- }
- }
- return null;
- }
- }
-
- private class EditCommitSetAction extends CommitSetAction {
-
- public EditCommitSetAction(ISynchronizePageConfiguration configuration) {
- super(Policy.bind("ChangeLogModelProvider.6"), configuration); //$NON-NLS-1$
- }
-
- public void run() {
- ChangeSet set = getSelectedSet();
- if (set == null) return;
- 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;
- // Nothing to do here as the set was updated by the dialog
- }
-
- }
-
- private class MakeDefaultCommitSetAction extends CommitSetAction {
-
- public MakeDefaultCommitSetAction(ISynchronizePageConfiguration configuration) {
- super(Policy.bind("ChangeLogModelProvider.9"), configuration); //$NON-NLS-1$
- }
-
- public void run() {
- ChangeSet set = getSelectedSet();
- if (set == null) return;
- CommitSetManager.getInstance().makeDefault(set);
- }
-
- }
-
- private class AddToCommitSetAction extends SynchronizeModelAction {
-
- private final ChangeSet set;
-
- public AddToCommitSetAction(ISynchronizePageConfiguration configuration, ChangeSet set, ISelection selection) {
- super(set.getTitle(), configuration);
- this.set = set;
- selectionChanged(selection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
- */
- protected FastSyncInfoFilter getSyncInfoFilter() {
- return OUTGOING_FILE_FILTER;
- }
-
- protected boolean needsToSaveDirtyEditors() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSubscriberOperation(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration, org.eclipse.compare.structuremergeviewer.IDiffElement[])
- */
- protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
- return new SynchronizeModelOperation(configuration, elements) {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- try {
- 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$
- }
- }
- };
- }
- }
-
- /*
+ /* *****************************************************************************
* Action that will open a commit set in a compare editor.
* It provides a comparison between the files in the
* commit set and their immediate predecessors.
@@ -427,28 +270,12 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
/* *****************************************************************************
* Action group for this layout. It is added and removed for this layout only.
*/
- public class ChangeLogActionGroup extends SynchronizePageActionGroup {
+ public class ChangeLogActionGroup extends ChangeSetManagementActionGroup {
private MenuManager sortByComment;
- private CreateCommitSetAction createCommitSet;
- private MenuManager addToCommitSet;
- private EditCommitSetAction editCommitSet;
- private MakeDefaultCommitSetAction makeDefault;
private OpenCommitSetAction openCommitSet;
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
sortByComment = new MenuManager(Policy.bind("ChangeLogModelProvider.0a")); //$NON-NLS-1$
- addToCommitSet = new MenuManager(Policy.bind("ChangeLogModelProvider.12")); //$NON-NLS-1$
- addToCommitSet.setRemoveAllWhenShown(true);
- addToCommitSet.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- addCommitSets(manager);
- }
- });
- createCommitSet = new CreateCommitSetAction(configuration);
- addToCommitSet.add(createCommitSet);
- addToCommitSet.add(new Separator());
- editCommitSet = new EditCommitSetAction(configuration);
- makeDefault = new MakeDefaultCommitSetAction(configuration);
openCommitSet = new OpenCommitSetAction(configuration);
appendToGroup(
@@ -460,18 +287,6 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
ISynchronizePageConfiguration.P_CONTEXT_MENU,
ISynchronizePageConfiguration.SORT_GROUP,
sortByComment);
- appendToGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
- COMMIT_SET_GROUP,
- addToCommitSet);
- appendToGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
- COMMIT_SET_GROUP,
- editCommitSet);
- appendToGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
- COMMIT_SET_GROUP,
- makeDefault);
ChangeLogModelProvider.this.initialize(configuration);
@@ -479,37 +294,38 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.2a"), ChangeLogModelSorter.DATE)); //$NON-NLS-1$
sortByComment.add(new ToggleSortOrderAction(Policy.bind("ChangeLogModelProvider.3a"), ChangeLogModelSorter.USER)); //$NON-NLS-1$
}
-
- protected void addCommitSets(IMenuManager manager) {
- 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++) {
- ChangeSet set = sets[i];
- AddToCommitSetAction action = new AddToCommitSetAction(getConfiguration(), set, selection);
- manager.add(action);
- }
- }
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizePageActionGroup#dispose()
*/
public void dispose() {
sortByComment.dispose();
- addToCommitSet.dispose();
sortByComment.removeAll();
- addToCommitSet.removeAll();
super.dispose();
}
-
-
- public void updateActionBars() {
- editCommitSet.selectionChanged((IStructuredSelection)getContext().getSelection());
- makeDefault.selectionChanged((IStructuredSelection)getContext().getSelection());
- super.updateActionBars();
+ protected ActiveChangeSet createChangeSet(final SubscriberChangeSetManager manager, final SyncInfo[] infos) {
+ ActiveChangeSet set = manager.createSet(Policy.bind("ChangeLogModelProvider.1"), new SyncInfo[0]); //$NON-NLS-1$
+ CommitSetDialog dialog = new CommitSetDialog(getConfiguration().getSite().getShell(), set, getResources(infos),
+ Policy.bind("ChangeLogModelProvider.2"), Policy.bind("ChangeLogModelProvider.3")); //$NON-NLS-1$ //$NON-NLS-2$
+ dialog.open();
+ if (dialog.getReturnCode() != InputDialog.OK) return null;
+ set.add(infos);
+ return set;
+ }
+ private IResource[] getResources(SyncInfo[] infos) {
+ IResource[] resources = new IResource[infos.length];
+ for (int i = 0; i < resources.length; i++) {
+ resources[i] = infos[i].getLocal();
+ }
+ return resources;
}
+ protected void editChangeSet(ActiveChangeSet set) {
+ 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;
+ // Nothing to do here as the set was updated by the dialog
+ }
}
/* *****************************************************************************
@@ -528,9 +344,8 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
/* *****************************************************************************
- * Action group for this layout. It is added and removed for this layout only.
+ * Background job to fetch commit comments and update view
*/
-
private class FetchLogEntriesJob extends Job {
private Set syncSets = new HashSet();
private boolean restoreExpansionState;
@@ -597,7 +412,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
super(configuration, set);
Assert.isNotNull(id);
this.id = id;
- configuration.addMenuGroup(ISynchronizePageConfiguration.P_CONTEXT_MENU, COMMIT_SET_GROUP);
+ configuration.addMenuGroup(ISynchronizePageConfiguration.P_CONTEXT_MENU, ChangeSetManagementActionGroup.CHANGE_SET_GROUP);
if (configuration.getComparisonType() == ISynchronizePageConfiguration.THREE_WAY) {
CommitSetManager.getInstance().addListener(this);
}
@@ -847,16 +662,21 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
* Add the local change to the appropriate outgoing commit set
*/
private void addLocalChange(SyncInfo info) {
- ChangeSet set = getCommitSetFor(info);
+ ActiveChangeSet set = getCommitSetFor(info);
if (set == null) {
+ // The change is not part of a change set so add it to the root provider
addToCommitSetProvider(info, getModelRoot());
} else {
- CommitSetDiffNode node = getDiffNodeFor(set);
+ // Ensure that a node exists for the active change set.
+ // The change is already part of the active change set
+ // so we don't need to add it again
+ ChangeSetDiffNode node = getDiffNodeFor(set);
if (node == null) {
- node = new CommitSetDiffNode(getModelRoot(), set);
+ node = new ChangeSetDiffNode(getModelRoot(), set);
addToViewer(node);
+ ISynchronizeModelProvider provider = createProviderRootedAt(node, set.getSyncInfoSet());
+ provider.prepareInput(null);
}
- addToCommitSetProvider(info, node);
}
}
@@ -892,13 +712,13 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private void addToCommitSetProvider(SyncInfo info, ISynchronizeModelElement parent) {
ISynchronizeModelProvider provider = getProviderRootedAt(parent);
if (provider == null) {
- provider = createProviderRootedAt(parent);
+ provider = createProviderRootedAt(parent, new SyncInfoTree());
}
provider.getSyncInfoSet().add(info);
}
- private ISynchronizeModelProvider createProviderRootedAt(ISynchronizeModelElement parent) {
- ISynchronizeModelProvider provider = createModelProvider(parent, id);
+ private ISynchronizeModelProvider createProviderRootedAt(ISynchronizeModelElement parent, SyncInfoTree set) {
+ ISynchronizeModelProvider provider = createModelProvider(parent, id, set);
addProvider(provider);
rootToProvider.put(parent, provider);
return provider;
@@ -949,13 +769,13 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
* Find an existing comment set
* TODO: we could do better than a linear lookup?
*/
- private CommitSetDiffNode getDiffNodeFor(ChangeSet set) {
+ private ChangeSetDiffNode getDiffNodeFor(ActiveChangeSet set) {
if (set == null) return null;
IDiffElement[] elements = getModelRoot().getChildren();
for (int i = 0; i < elements.length; i++) {
IDiffElement element = elements[i];
- if(element instanceof CommitSetDiffNode) {
- CommitSetDiffNode node = (CommitSetDiffNode)element;
+ if(element instanceof ChangeSetDiffNode) {
+ ChangeSetDiffNode node = (ChangeSetDiffNode)element;
if(node.getSet() == set) {
return node;
}
@@ -969,10 +789,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 ChangeSet getCommitSetFor(SyncInfo info) {
- ChangeSet[] sets = CommitSetManager.getInstance().getSets();
+ private ActiveChangeSet getCommitSetFor(SyncInfo info) {
+ ActiveChangeSet[] sets = CommitSetManager.getInstance().getSets();
for (int i = 0; i < sets.length; i++) {
- ChangeSet set = sets[i];
+ ActiveChangeSet set = sets[i];
if (set.contains(info.getLocal())) {
return set;
}
@@ -1242,21 +1062,21 @@ 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(ChangeSet set) {
+ public void setAdded(ActiveChangeSet 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(ChangeSet set) {
+ public void setRemoved(ActiveChangeSet 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(ChangeSet set) {
+ public void titleChanged(ActiveChangeSet 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.getResources(), true /* we may not be in the UI thread */);
@@ -1339,7 +1159,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
*/
private void createRootProvider() {
// Recreate the sub-provider at the root and use it's viewer sorter and action group
- final ISynchronizeModelProvider provider = createProviderRootedAt(getModelRoot());
+ final ISynchronizeModelProvider provider = createProviderRootedAt(getModelRoot(), new SyncInfoTree());
embeddedSorter = provider.getViewerSorter();
if (provider instanceof AbstractSynchronizeModelProvider) {
SynchronizePageActionGroup actionGroup = ((AbstractSynchronizeModelProvider)provider).getActionGroup();
@@ -1377,7 +1197,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
/* (non-Javadoc)
* @see org.eclipse.team.core.change.IChangeSetChangeListener#defaultSetChanged(org.eclipse.team.core.change.ChangeSet)
*/
- public void defaultSetChanged(ChangeSet oldDefault, ChangeSet set) {
+ public void defaultSetChanged(ActiveChangeSet oldDefault, ActiveChangeSet set) {
if (oldDefault != null) {
refreshNode(getDiffNodeFor(oldDefault));
}
@@ -1386,13 +1206,27 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
}
-
-
/* (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 */);
+ public void resourcesChanged(ActiveChangeSet set, IResource[] resources) {
+ // Any element that has been added to the set sould be removed
+ // from the root set
+ ISynchronizeModelProvider provider = getProviderRootedAt(getModelRoot());
+ if (provider != null) {
+ SyncInfoSet syncInfoSet = provider.getSyncInfoSet();
+ try {
+ syncInfoSet.beginInput();
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ if (syncInfoSet.getSyncInfo(resource) != null) {
+ syncInfoSet.remove(resource);
+ }
+ }
+ } finally {
+ syncInfoSet.endInput(null);
+ }
+ }
}
}
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 a50da08b6..8f8009ac8 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,8 +12,9 @@ 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.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
+import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
/**
@@ -37,7 +38,7 @@ public class ChangeLogModelSorter extends ViewerSorter {
}
protected int classComparison(Object element) {
- if (element instanceof CommitSetDiffNode) {
+ if (element instanceof ChangeSetDiffNode) {
return 0;
}
if (element instanceof ChangeLogDiffNode) {
@@ -61,9 +62,9 @@ public class ChangeLogModelSorter extends ViewerSorter {
//have to deal with non-resources in navigator
//if one or both objects are not resources, returned a comparison
//based on class.
- if (o1 instanceof CommitSetDiffNode && o2 instanceof CommitSetDiffNode) {
- ChangeSet s1 = ((CommitSetDiffNode) o1).getSet();
- ChangeSet s2 = ((CommitSetDiffNode) o2).getSet();
+ if (o1 instanceof ChangeSetDiffNode && o2 instanceof ChangeSetDiffNode) {
+ ActiveChangeSet s1 = (ActiveChangeSet)((ChangeSetDiffNode) o1).getSet();
+ ActiveChangeSet s2 = (ActiveChangeSet)((ChangeSetDiffNode) o2).getSet();
return compareNames(s1.getTitle(), s2.getTitle());
}
@@ -81,9 +82,9 @@ public class ChangeLogModelSorter extends ViewerSorter {
return 0;
}
- if (o1 instanceof CommitSetDiffNode)
+ if (o1 instanceof ChangeSetDiffNode)
return 1;
- else if (o2 instanceof CommitSetDiffNode)
+ else if (o2 instanceof ChangeSetDiffNode)
return -1;
if (o1 instanceof ChangeLogDiffNode)
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 612e32136..607cdf233 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
@@ -20,7 +20,7 @@ import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
-import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.ui.help.WorkbenchHelp;
@@ -30,7 +30,7 @@ import org.eclipse.ui.help.WorkbenchHelp;
*/
public class CommitSetDialog extends Dialog {
- private final ChangeSet set;
+ private final ActiveChangeSet set;
private CommitCommentArea commitCommentArea;
private Text nameText;
private Button useTitleButton;
@@ -39,7 +39,7 @@ public class CommitSetDialog extends Dialog {
private final String description;
private String comment;
- public CommitSetDialog(Shell parentShell, ChangeSet set, IResource[] files, String title, String description) {
+ public CommitSetDialog(Shell parentShell, ActiveChangeSet set, IResource[] files, String title, String description) {
super(parentShell);
this.set = set;
this.title = title;
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 7ad106c4b..7b3795ade 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,7 +22,7 @@ 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.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.core.*;
@@ -267,10 +267,10 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
private String getProposedComment(IResource[] resourcesToCommit) {
StringBuffer comment = new StringBuffer();
- ChangeSet[] sets = CommitSetManager.getInstance().getSets();
+ ActiveChangeSet[] sets = CommitSetManager.getInstance().getSets();
int numMatchedSets = 0;
for (int i = 0; i < sets.length; i++) {
- ChangeSet set = sets[i];
+ ActiveChangeSet set = sets[i];
if (containsOne(set, resourcesToCommit)) {
if(numMatchedSets > 0) comment.append(System.getProperty("line.separator")); //$NON-NLS-1$
comment.append(set.getComment());
@@ -280,7 +280,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
return comment.toString();
}
- private boolean containsAll(ChangeSet set, IResource[] resourcesToCommit) {
+ private boolean containsAll(ActiveChangeSet set, IResource[] resourcesToCommit) {
for (int j = 0; j < resourcesToCommit.length; j++) {
IResource resource = resourcesToCommit[j];
if (!set.contains(resource)) {
@@ -290,7 +290,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
return true;
}
- private boolean containsOne(ChangeSet set, IResource[] resourcesToCommit) {
+ private boolean containsOne(ActiveChangeSet set, IResource[] resourcesToCommit) {
for (int j = 0; j < resourcesToCommit.length; j++) {
IResource resource = resourcesToCommit[j];
if (set.contains(resource)) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index 5de423803..fcde2b625 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -151,6 +151,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
// The manager adds itself to the configuration in it's constructor
new ChangeLogModelManager(configuration);
+ configuration.setProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER, CommitSetManager.getInstance());
// Add context menu groups here to give the client displaying the
// page a chance to remove the context menu
diff --git a/bundles/org.eclipse.team.ui/icons/full/obj/changeset_obj.gif b/bundles/org.eclipse.team.ui/icons/full/obj/changeset_obj.gif
new file mode 100644
index 000000000..f98800321
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/icons/full/obj/changeset_obj.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ITeamUIImages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ITeamUIImages.java
index b5fa0756f..26370580e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ITeamUIImages.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ITeamUIImages.java
@@ -173,6 +173,7 @@ public interface ITeamUIImages {
public final String IMG_HIERARCHICAL = "elcl16/hierarchicalLayout.gif"; //$NON-NLS-1$
public final String IMG_FLAT = "elcl16/flatLayout.gif"; //$NON-NLS-1$
public final String IMG_SYNC_VIEW = "eview16/synch_synch.gif"; //$NON-NLS-1$
+ public final String IMG_CHANGE_SET = "obj/changeset_obj.gif"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
index cd1752913..6cf217192 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider.java
@@ -627,15 +627,28 @@ public abstract class AbstractSynchronizeModelProvider implements ISynchronizeMo
}
}
// Remove the node from the tree
- IDiffContainer parent = node.getParent();
- if (parent != null) {
- parent.removeToRoot(node);
- }
+ removeToRoot(node);
+
// Notify the update handler that the node has been cleared
updateHandler.modelObjectCleared(node);
}
- /**
+ /*
+ * Remove to root should only remove to the root of the provider and not the
+ * diff tree.
+ */
+ private void removeToRoot(ISynchronizeModelElement node) {
+ if (node == getModelRoot()) return;
+ IDiffContainer parent = node.getParent();
+ if (parent != null) {
+ ((SynchronizeModelElement)parent).remove(node);
+ if (!parent.hasChildren()) {
+ removeToRoot((ISynchronizeModelElement)parent);
+ }
+ }
+ }
+
+ /**
* Return the provider that created and manages the given
* model element. The default is to return the receiver.
* Subclasses may override.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetDiffNode.java
index 554106326..b05f5feb7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDiffNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetDiffNode.java
@@ -8,25 +8,23 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ccvs.ui.subscriber;
+package org.eclipse.team.internal.ui.synchronize;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.core.subscribers.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;
-import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
+import org.eclipse.team.internal.ui.ITeamUIImages;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
/**
- * This diff node represents an outgoing commit set when it appears in the
- * synchronize view.
+ * Node that represents a Change set in a synchronize page.
*/
-public class CommitSetDiffNode extends SynchronizeModelElement {
+public class ChangeSetDiffNode extends SynchronizeModelElement {
private final ChangeSet set;
- public CommitSetDiffNode(ISynchronizeModelElement parent, ChangeSet set) {
+ public ChangeSetDiffNode(IDiffContainer parent, ChangeSet set) {
super(parent);
this.set = set;
}
@@ -46,15 +44,14 @@ public class CommitSetDiffNode extends SynchronizeModelElement {
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
public ImageDescriptor getImageDescriptor(Object object) {
- return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CHANGELOG); // TODO: Custom image needed
+ return TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_CHANGE_SET);
}
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffNode#getName()
*/
public String getName() {
- String name = set.getTitle();
- return name;
+ return set.getName();
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetManagementActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetManagementActionGroup.java
new file mode 100644
index 000000000..0554a1f1f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetManagementActionGroup.java
@@ -0,0 +1,278 @@
+/*******************************************************************************
+ * 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.ui.synchronize;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
+import org.eclipse.team.core.subscribers.SubscriberChangeSetManager;
+import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.synchronize.FastSyncInfoFilter.AndSyncInfoFilter;
+import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
+import org.eclipse.team.internal.core.Policy;
+import org.eclipse.team.internal.ui.actions.TeamAction;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+
+/**
+ * This action group contributes actions that support the management
+ * of Change sets to a synchronize page.
+ */
+public abstract class ChangeSetManagementActionGroup extends SynchronizePageActionGroup {
+
+ public final static String CHANGE_SET_GROUP = "chaneg_set_group"; //$NON-NLS-1$
+
+ public static final AndSyncInfoFilter OUTGOING_FILE_FILTER = new AndSyncInfoFilter(new FastSyncInfoFilter[] {
+ new FastSyncInfoFilter() {
+ public boolean select(SyncInfo info) {
+ return info.getLocal().getType() == IResource.FILE;
+ }
+ },
+ new SyncInfoDirectionFilter(new int[] { SyncInfo.OUTGOING, SyncInfo.CONFLICTING })
+ });
+
+ private class CreateChangeSetAction extends SynchronizeModelAction {
+
+ public CreateChangeSetAction(ISynchronizePageConfiguration configuration) {
+ super(Policy.bind("ChangeLogModelProvider.0"), configuration); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#needsToSaveDirtyEditors()
+ */
+ protected boolean needsToSaveDirtyEditors() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
+ */
+ protected FastSyncInfoFilter getSyncInfoFilter() {
+ return OUTGOING_FILE_FILTER;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSubscriberOperation(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration, org.eclipse.compare.structuremergeviewer.IDiffElement[])
+ */
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new SynchronizeModelOperation(configuration, elements) {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ syncExec(new Runnable() {
+ public void run() {
+ SyncInfo[] infos = getSyncInfoSet().getSyncInfos();
+ ActiveChangeSet set = createChangeSet(getChangeSetManager(), infos);
+ getChangeSetManager().add(set);
+ }
+ });
+ }
+ };
+ }
+ }
+
+ private abstract class ChangeSetAction extends BaseSelectionListenerAction {
+
+ public ChangeSetAction(String title, ISynchronizePageConfiguration configuration) {
+ super(title);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ protected boolean updateSelection(IStructuredSelection selection) {
+ return getSelectedSet() != null;
+ }
+
+ protected ActiveChangeSet getSelectedSet() {
+ IStructuredSelection selection = getStructuredSelection();
+ if (selection.size() == 1) {
+ Object first = selection.getFirstElement();
+ return (ActiveChangeSet)TeamAction.getAdapter(first, ActiveChangeSet.class);
+ }
+ return null;
+ }
+ }
+
+ private class EditChangeSetAction extends ChangeSetAction {
+
+ public EditChangeSetAction(ISynchronizePageConfiguration configuration) {
+ super(Policy.bind("ChangeLogModelProvider.6"), configuration); //$NON-NLS-1$
+ }
+
+ public void run() {
+ ActiveChangeSet set = getSelectedSet();
+ if (set == null) return;
+ editChangeSet(set);
+ }
+ }
+
+ private class MakeDefaultChangeSetAction extends ChangeSetAction {
+
+ public MakeDefaultChangeSetAction(ISynchronizePageConfiguration configuration) {
+ super(Policy.bind("ChangeLogModelProvider.9"), configuration); //$NON-NLS-1$
+ }
+
+ public void run() {
+ ActiveChangeSet set = getSelectedSet();
+ if (set == null) return;
+ getChangeSetManager().makeDefault(set);
+ }
+
+ }
+
+ private class AddToChangeSetAction extends SynchronizeModelAction {
+
+ private final ActiveChangeSet set;
+
+ public AddToChangeSetAction(ISynchronizePageConfiguration configuration, ActiveChangeSet set, ISelection selection) {
+ super(set.getTitle(), configuration);
+ this.set = set;
+ selectionChanged(selection);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
+ */
+ protected FastSyncInfoFilter getSyncInfoFilter() {
+ return OUTGOING_FILE_FILTER;
+ }
+
+ protected boolean needsToSaveDirtyEditors() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSubscriberOperation(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration, org.eclipse.compare.structuremergeviewer.IDiffElement[])
+ */
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new SynchronizeModelOperation(configuration, elements) {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ set.add(getSyncInfoSet().getSyncInfos());
+ }
+ };
+ }
+ }
+
+ private CreateChangeSetAction createChangeSet;
+ private MenuManager addToChangeSet;
+ private EditChangeSetAction editChangeSet;
+ private MakeDefaultChangeSetAction makeDefault;
+ private boolean alive = false;
+
+ public void initialize(ISynchronizePageConfiguration configuration) {
+ super.initialize(configuration);
+ if (getChangeSetManager() == null) return;
+ alive = true;
+ addToChangeSet = new MenuManager(Policy.bind("ChangeLogModelProvider.12")); //$NON-NLS-1$
+ addToChangeSet.setRemoveAllWhenShown(true);
+ addToChangeSet.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ addChangeSets(manager);
+ }
+ });
+ createChangeSet = new CreateChangeSetAction(configuration);
+ addToChangeSet.add(createChangeSet);
+ addToChangeSet.add(new Separator());
+ editChangeSet = new EditChangeSetAction(configuration);
+ makeDefault = new MakeDefaultChangeSetAction(configuration);
+
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CHANGE_SET_GROUP,
+ addToChangeSet);
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CHANGE_SET_GROUP,
+ editChangeSet);
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CHANGE_SET_GROUP,
+ makeDefault);
+ }
+
+ protected void addChangeSets(IMenuManager manager) {
+ ActiveChangeSet[] sets = getChangeSetManager().getSets();
+ ISelection selection = getContext().getSelection();
+ createChangeSet.selectionChanged(selection);
+ addToChangeSet.add(createChangeSet);
+ addToChangeSet.add(new Separator());
+ for (int i = 0; i < sets.length; i++) {
+ ActiveChangeSet set = sets[i];
+ AddToChangeSetAction action = new AddToChangeSetAction(getConfiguration(), set, selection);
+ manager.add(action);
+ }
+ }
+
+ /**
+ * Return the change set manager for the current page.
+ * @return the change set manager for the current page
+ */
+ protected SubscriberChangeSetManager getChangeSetManager() {
+ return (SubscriberChangeSetManager)getConfiguration().getProperty(ISynchronizePageConfiguration.P_CHANGE_SET_MANAGER);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SynchronizePageActionGroup#dispose()
+ */
+ public void dispose() {
+ if (alive) {
+ addToChangeSet.dispose();
+ addToChangeSet.removeAll();
+ }
+ super.dispose();
+ }
+
+
+ public void updateActionBars() {
+ if (alive) {
+ editChangeSet.selectionChanged((IStructuredSelection)getContext().getSelection());
+ makeDefault.selectionChanged((IStructuredSelection)getContext().getSelection());
+ }
+ super.updateActionBars();
+ }
+
+ private void syncExec(final Runnable runnable) {
+ final Control ctrl = getConfiguration().getPage().getViewer().getControl();
+ if (ctrl != null && !ctrl.isDisposed()) {
+ ctrl.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ if (!ctrl.isDisposed()) {
+ runnable.run();
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Create a change set from the given manager that contains the given sync info.
+ * This method is invoked from the UI thread.
+ * @param manager a change set manager
+ * @param infos the sync info to be added to the change set
+ * @return the created set.
+ */
+ protected abstract ActiveChangeSet createChangeSet(SubscriberChangeSetManager manager, SyncInfo[] infos);
+
+ /**
+ * Edit the title and comment of the given change set.
+ * This method is invoked from the UI thread.
+ * @param set the set to be edited
+ */
+ protected abstract void editChangeSet(ActiveChangeSet set);
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
index 5c936613a..274bd0d0e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/CompositeModelProvider.java
@@ -262,13 +262,13 @@ public abstract class CompositeModelProvider extends AbstractSynchronizeModelPro
* @param id the id of the providers descriptor
* @return the new provider
*/
- protected ISynchronizeModelProvider createModelProvider(ISynchronizeModelElement parent, String id) {
- if (id.endsWith(FlatModelProvider.FlatModelProviderDescriptor.ID)) {
- return new FlatModelProvider(this, parent, getConfiguration(), new SyncInfoTree());
+ protected ISynchronizeModelProvider createModelProvider(ISynchronizeModelElement parent, String id, SyncInfoTree syncInfoTree) {
+ if (id.endsWith(FlatModelProvider.FlatModelProviderDescriptor.ID)) {
+ return new FlatModelProvider(this, parent, getConfiguration(), syncInfoTree);
} else if(id.endsWith(CompressedFoldersModelProvider.CompressedFolderModelProviderDescriptor.ID)) {
- return new CompressedFoldersModelProvider(this, parent, getConfiguration(), new SyncInfoTree());
+ return new CompressedFoldersModelProvider(this, parent, getConfiguration(), syncInfoTree);
} else {
- return new HierarchicalModelProvider(this, parent, getConfiguration(), new SyncInfoTree());
+ return new HierarchicalModelProvider(this, parent, getConfiguration(), syncInfoTree);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
index 7e52b7984..67de83bd6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
@@ -98,6 +98,13 @@ public interface ISynchronizePageConfiguration {
public static final String P_SUPPORTED_MODES = TeamUIPlugin.ID + ".P_SUPPORTED_MODES"; //$NON-NLS-1$
/**
+ * Property constant which indicates the change set manager.
+ * The value is to be an instance of <code>SubscriberChangeSetManager</code>.
+ * A value of <code>null</code> indicates that there is no change set manager.
+ */
+ public static final String P_CHANGE_SET_MANAGER = TeamUIPlugin.ID + ".P_CHANGE_SET_MANAGER"; //$NON-NLS-1$
+
+ /**
* The id of the synchronize group the determines where the synchronize
* actions appear.
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
index 6d79a4c07..ff19d48b4 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
@@ -339,4 +339,16 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
}
actions.add(action);
}
+
+ /**
+ * Return the configuration for the page to which the action group
+ * is associated.
+ * @return the configuration for the page to which the action group
+ * is associated
+ *
+ * @since 3.1
+ */
+ public ISynchronizePageConfiguration getConfiguration() {
+ return configuration;
+ }
}
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 56229f5f1..7af99b722 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
@@ -33,21 +33,21 @@ public class CommitSetTests extends EclipseTest {
private List addedSets = new ArrayList();
private List removedSets = new ArrayList();
private IChangeSetChangeListener listener = new IChangeSetChangeListener() {
- public void setAdded(ChangeSet set) {
+ public void setAdded(ActiveChangeSet set) {
addedSets.add(set);
}
- public void setRemoved(ChangeSet set) {
+ public void setRemoved(ActiveChangeSet set) {
removedSets.add(set);
}
- public void titleChanged(ChangeSet set) {
+ public void titleChanged(ActiveChangeSet set) {
// TODO Auto-generated method stub
}
- public void defaultSetChanged(ChangeSet oldDefault, ChangeSet set) {
+ public void defaultSetChanged(ActiveChangeSet oldDefault, ActiveChangeSet set) {
// TODO Auto-generated method stub
}
- public void resourcesChanged(ChangeSet set, IResource[] resources) {
+ public void resourcesChanged(ActiveChangeSet set, IResource[] resources) {
// TODO Auto-generated method stub
}
@@ -72,10 +72,10 @@ public class CommitSetTests extends EclipseTest {
* @return the newly create commit set
* @throws TeamException
*/
- protected ChangeSet createCommitSet(String title, IFile[] files, boolean manageSet) throws TeamException {
+ protected ActiveChangeSet createCommitSet(String title, IFile[] files, boolean manageSet) throws TeamException {
assertIsModified(getName(), files);
SubscriberChangeSetManager manager = CommitSetManager.getInstance();
- ChangeSet set = manager.createSet(title, files);
+ ActiveChangeSet set = manager.createSet(title, files);
assertEquals("Not all files were asdded to the set", files.length, set.getResources().length);
if (manageSet) {
manager.add(set);
@@ -91,7 +91,7 @@ public class CommitSetTests extends EclipseTest {
* @param set the commit set
* @throws CVSException
*/
- protected void commit(ChangeSet set) throws CoreException {
+ protected void commit(ActiveChangeSet set) throws CoreException {
boolean isManaged = setIsManaged(set);
commitResources(set.getResources(), IResource.DEPTH_ZERO);
if (isManaged) {
@@ -100,11 +100,11 @@ public class CommitSetTests extends EclipseTest {
}
}
- private boolean setIsManaged(ChangeSet set) {
+ private boolean setIsManaged(ActiveChangeSet set) {
return CommitSetManager.getInstance().contains(set);
}
- private void waitForSetAddedEvent(ChangeSet set) {
+ private void waitForSetAddedEvent(ActiveChangeSet set) {
int count = 0;
while (count < 5) {
if (addedSets.contains(set)) {
@@ -121,7 +121,7 @@ public class CommitSetTests extends EclipseTest {
fail("Did not receive expected set added event");
}
- private void waitForSetRemovedEvent(ChangeSet set) {
+ private void waitForSetRemovedEvent(ActiveChangeSet set) {
int count = 0;
while (count < 5) {
if (removedSets.contains(set)) {
@@ -171,7 +171,7 @@ public class CommitSetTests extends EclipseTest {
project.getFile("changed.txt"),
project.getFile("deleted.txt"),
project.getFile("added.txt")};
- ChangeSet set = createCommitSet("testSimpleCommit", files, false /* do not manage the set */);
+ ActiveChangeSet set = createCommitSet("testSimpleCommit", files, false /* do not manage the set */);
commit(set);
assertLocalStateEqualsRemote(project);
}
@@ -193,7 +193,7 @@ public class CommitSetTests extends EclipseTest {
project.getFile("changed.txt"),
project.getFile("deleted.txt"),
project.getFile("added.txt")};
- ChangeSet set = createCommitSet("testSimpleCommit", files, true /* manage the set */);
+ ActiveChangeSet set = createCommitSet("testSimpleCommit", files, true /* manage the set */);
commit(set);
assertLocalStateEqualsRemote(project);
}

Back to the top