Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-04-17 00:42:41 -0400
committerJean Michel-Lemieux2002-04-17 00:42:41 -0400
commit30e66894211c3b705d194903917fe0d0a054ca74 (patch)
treeeb0f32acb0dad8adffc9727e766e4439bcf6e7d8
parentc17e699e5826459ba851f132a986a50e8ebcdc37 (diff)
downloadeclipse.platform.team-30e66894211c3b705d194903917fe0d0a054ca74.tar.gz
eclipse.platform.team-30e66894211c3b705d194903917fe0d0a054ca74.tar.xz
eclipse.platform.team-30e66894211c3b705d194903917fe0d0a054ca74.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ReentrantLock.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml14
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java46
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java48
8 files changed, 85 insertions, 58 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ReentrantLock.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ReentrantLock.java
index dae4bd4e2..7e33d893f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ReentrantLock.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ReentrantLock.java
@@ -38,15 +38,15 @@ public class ReentrantLock {
if (thread != thisThread) {
while (nestingCount != 0) {
try {
- if(DEBUG) System.out.println("["+ thisThread.getName() + "] waiting for CVS synchronizer lock");
+ if(DEBUG) System.out.println("["+ thisThread.getName() + "] waiting for CVS synchronizer lock"); //$NON-NLS-1$ //$NON-NLS-2$
wait();
} catch(InterruptedException e) {
// keep waiting for the lock
- if(DEBUG) System.out.println("["+ thisThread.getName() + "] interrupted in CVS synchronizer lock");
+ if(DEBUG) System.out.println("["+ thisThread.getName() + "] interrupted in CVS synchronizer lock"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
thread = thisThread;
- if(DEBUG) System.out.println("[" + thisThread.getName() + "] acquired CVS synchronizer lock");
+ if(DEBUG) System.out.println("[" + thisThread.getName() + "] acquired CVS synchronizer lock"); //$NON-NLS-1$ //$NON-NLS-2$
}
nestingCount++;
}
@@ -54,9 +54,9 @@ public class ReentrantLock {
public synchronized void release() {
Thread thisThread = Thread.currentThread();
Assert.isLegal(thread == thisThread,
- "Thread attempted to release a lock it did not own");
+ "Thread attempted to release a lock it did not own"); //$NON-NLS-1$
if (--nestingCount == 0) {
- if(DEBUG) System.out.println("[" + thread.getName() + "] released CVS synchronizer lock");
+ if(DEBUG) System.out.println("[" + thread.getName() + "] released CVS synchronizer lock"); //$NON-NLS-1$ //$NON-NLS-2$
thread = null;
notifyAll();
}
@@ -65,7 +65,7 @@ public class ReentrantLock {
public int getNestingCount() {
Thread thisThread = Thread.currentThread();
Assert.isLegal(thread == thisThread,
- "Thread attempted to read nesting count of a lock it did not own");
+ "Thread attempted to read nesting count of a lock it did not own"); //$NON-NLS-1$
return nestingCount;
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
index 8a1b46801..91947d802 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java
@@ -330,10 +330,26 @@ public class ResourceSyncInfo {
public String toString() {
return getEntryLine(true, null /*no timestamp override*/);
}
+
+ /**
+ * Returns an editable copy of this resource sync.
+ */
public MutableResourceSyncInfo cloneMutable() {
MutableResourceSyncInfo newSync = new MutableResourceSyncInfo(this);
return newSync;
}
+
+ /**
+ * Answers if this resource sync is sticky.
+ */
+ public boolean isSticky() {
+ CVSTag tag = getTag();
+ if(tag != null && tag.getType() != CVSTag.BRANCH) {
+ return true;
+ }
+ return false;
+ }
+
/**
* Sets the tag for the resource.
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 757998337..d6a24338e 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -189,6 +189,13 @@
menubarPath="team.main/group1"
id="org.eclipse.team.ccvs.ui.sync">
</action>
+ <action
+ label="%ReplaceWithTagAction.label"
+ tooltip="%ReplaceWithTagAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithTagAction"
+ menubarPath="replaceWithMenu/replaceWithGroup"
+ id="org.eclipse.team.ccvs.ui.replaceWithTag">
+ </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IProject"
@@ -219,13 +226,6 @@
menubarPath="team.main/group2"
id="org.eclipse.team.ccvs.ui.branch">
</action>
- <action
- label="%ReplaceWithTagAction.label"
- tooltip="%ReplaceWithTagAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithTagAction"
- menubarPath="replaceWithMenu/replaceWithGroup"
- id="org.eclipse.team.ccvs.ui.replaceWithTag">
- </action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IFolder"
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
index 4acf934e7..f05dd9476 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
@@ -197,6 +197,10 @@ public class CVSDecorationRunnable implements Runnable {
KSubstOption.fromFile((IFile) resource);
bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, option.getShortDisplayText());
if (tag != null && (tag.getType() != CVSTag.HEAD)) {
+ String modifiedTag;
+ if(tag.getName().equals(fileInfo.getRevision())) {
+ modifiedTag = "Sticky";
+ }
bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, tag.getName());
}
} else {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index 9fbe349fc..0a9817f07 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -135,7 +135,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
String revision = entry.getRevision();
if (file == null) return revision;
if (currentRevision != null && currentRevision.equals(revision)) {
- Policy.bind("currentRevision", revision); //$NON-NLS-1$
+ revision = Policy.bind("currentRevision", revision); //$NON-NLS-1$
}
return revision;
case COL_TAGS:
@@ -215,24 +215,23 @@ public class HistoryView extends ViewPart implements ISelectionListener {
});
-// This code will add an action that allows getting a sticky revision of a file.
-// It has been left removed until we can support removing the stickiness of
-// the file.
-// getRevisionAction = getContextMenuAction(Policy.bind("HistoryView.getRevisionAction"), new IWorkspaceRunnable() {
-// public void run(IProgressMonitor monitor) throws CoreException {
-// ICVSRemoteFile remoteFile = currentSelection.getRemoteFile();
-// try {
-// if(confirmOverwrite()) {
-// CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(file.getProject());
-// CVSTag revisionTag = new CVSTag(remoteFile.getRevision(), CVSTag.VERSION);
-// provider.update(new IResource[] {file}, new Command.LocalOption[] {Command.UPDATE.IGNORE_LOCAL_CHANGES},
-// revisionTag, true /*create backups*/, monitor);
-// }
-// } catch (TeamException e) {
-// throw new CoreException(e.getStatus());
-// }
-// }
-// });
+ getRevisionAction = getContextMenuAction(Policy.bind("HistoryView.getRevisionAction"), new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ICVSRemoteFile remoteFile = currentSelection.getRemoteFile();
+ try {
+ if(confirmOverwrite()) {
+ CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(file.getProject());
+ CVSTag revisionTag = new CVSTag(remoteFile.getRevision(), CVSTag.VERSION);
+ provider.update(new IResource[] {file}, new Command.LocalOption[] {Command.UPDATE.IGNORE_LOCAL_CHANGES},
+ revisionTag, true /*create backups*/, monitor);
+ currentRevision = revisionTag.getName();
+ tableViewer.refresh();
+ }
+ } catch (TeamException e) {
+ throw new CoreException(e.getStatus());
+ }
+ }
+ });
@@ -583,7 +582,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
if (!sel.isEmpty()) {
if (sel instanceof IStructuredSelection) {
if (((IStructuredSelection)sel).size() == 1) {
- //manager.add(getRevisionAction);
+ manager.add(getRevisionAction);
manager.add(getContentsAction);
}
}
@@ -621,7 +620,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
if (first instanceof IResource) {
showHistory((IResource)first);
} else if (first instanceof ICVSRemoteFile) {
- showHistory((ICVSRemoteFile)first);
+ showHistory((ICVSRemoteFile)first, null /* no current revision */);
}
}
}
@@ -668,12 +667,13 @@ public class HistoryView extends ViewPart implements ISelectionListener {
/**
* Shows the history for the given ICVSRemoteFile in the view.
*/
- public void showHistory(ICVSRemoteFile file) {
+ public void showHistory(ICVSRemoteFile file, String currentRevision) {
if (file == null) {
tableViewer.setInput(null);
setTitle(Policy.bind("HistoryView.title")); //$NON-NLS-1$
return;
}
+ this.currentRevision = currentRevision;
this.file = null;
tableViewer.setInput(file);
setTitle(Policy.bind("HistoryView.titleWithArgument", file.getName())); //$NON-NLS-1$
@@ -689,7 +689,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
IStructuredSelection ss = (IStructuredSelection)selection;
Object o = ss.getFirstElement();
currentSelection = (ILogEntry)o;
- new ProgressMonitorDialog(getViewSite().getShell()).run(true, true, new WorkspaceModifyOperation() {
+ new ProgressMonitorDialog(getViewSite().getShell()).run(false, true, new WorkspaceModifyOperation() {
protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
action.run(monitor);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
index be8f69bf5..86e112f90 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java
@@ -66,7 +66,7 @@ public class ShowHistoryAction extends TeamAction {
ICVSRemoteFile[] files = getSelectedRemoteFiles();
HistoryView view = HistoryView.openInActivePerspective();
if (view != null) {
- view.showHistory(files[0]);
+ view.showHistory(files[0], null /* no current revision */);
}
}
}, Policy.bind("ShowHistoryAction.showHistory"), this.PROGRESS_BUSYCURSOR); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index ab3074f78..ba5dda03b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -297,6 +297,7 @@ HistoryFilterDialog.fromDate = &From date (M/D/Y) :
HistoryFilterDialog.toDate = &To date (M/D/Y) :
HistoryView.getContentsAction=&Get Contents
+HistoryView.getRevisionAction=Get &Revision
HistoryView.copy=&Copy
HistoryView.revision=Revision
HistoryView.tags=Tags
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index c42e9a164..b7e178ace 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -41,8 +41,8 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.HistoryView;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.OverlayIcon;
-import org.eclipse.team.internal.ccvs.ui.OverlayIconCache;
+import org.eclipse.team.internal.ccvs.ui.OverlayIcon;
+import org.eclipse.team.internal.ccvs.ui.OverlayIconCache;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.merge.OverrideUpdateMergeAction;
import org.eclipse.team.internal.ccvs.ui.merge.UpdateMergeAction;
@@ -65,20 +65,20 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
private HistoryAction showInHistory;
private OverrideUpdateMergeAction forceUpdateMergeAction;
- private static class DiffOverlayIcon extends OverlayIcon {
- private static final int HEIGHT = 16;
- private static final int WIDTH = 22;
- public DiffOverlayIcon(Image baseImage, ImageDescriptor overlay) {
- super(baseImage, new ImageDescriptor[] { overlay }, new Point(WIDTH, HEIGHT));
+ private static class DiffOverlayIcon extends OverlayIcon {
+ private static final int HEIGHT = 16;
+ private static final int WIDTH = 22;
+ public DiffOverlayIcon(Image baseImage, ImageDescriptor overlay) {
+ super(baseImage, new ImageDescriptor[] { overlay }, new Point(WIDTH, HEIGHT));
}
- protected void drawOverlays(ImageDescriptor[] overlays) {
- ImageDescriptor overlay = overlays[0];
+ protected void drawOverlays(ImageDescriptor[] overlays) {
+ ImageDescriptor overlay = overlays[0];
ImageData overlayData = overlay.getImageData();
drawImage(overlayData, WIDTH - overlayData.width, (HEIGHT - overlayData.height) / 2);
}
}
-
- private static class HistoryAction extends Action implements ISelectionChangedListener {
+
+ private static class HistoryAction extends Action implements ISelectionChangedListener {
IStructuredSelection selection;
public HistoryAction(String label) {
super(label);
@@ -98,10 +98,16 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
ICVSRemoteFile baseFile = (ICVSRemoteFile)remoteSyncElement.getBase();
// can only show history if remote exists or local has a base.
+ String currentRevision = null;
+ try {
+ currentRevision = baseFile!=null ? baseFile.getRevision(): null;
+ } catch(TeamException e) {
+ CVSUIPlugin.log(e.getStatus());
+ }
if(remoteFile!=null) {
- view.showHistory(remoteFile);
+ view.showHistory(remoteFile, currentRevision);
} else if(baseFile!=null) {
- view.showHistory(baseFile);
+ view.showHistory(baseFile, currentRevision);
}
}
public void selectionChanged(SelectionChangedEvent event) {
@@ -143,19 +149,19 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
final ImageDescriptor questionableDescriptor = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_QUESTIONABLE);
final LabelProvider oldProvider = (LabelProvider)getLabelProvider();
setLabelProvider(new LabelProvider() {
- private OverlayIconCache iconCache = new OverlayIconCache();
-
- public void dispose() {
- iconCache.disposeAll();
- oldProvider.dispose();
- }
+ private OverlayIconCache iconCache = new OverlayIconCache();
+
+ public void dispose() {
+ iconCache.disposeAll();
+ oldProvider.dispose();
+ }
public Image getImage(Object element) {
Image image = oldProvider.getImage(element);
if (element instanceof ITeamNode) {
ITeamNode node = (ITeamNode)element;
int kind = node.getKind();
if ((kind & IRemoteSyncElement.AUTOMERGE_CONFLICT) != 0) {
- return iconCache.getImageFor(new DiffOverlayIcon(image, conflictDescriptor));
+ return iconCache.getImageFor(new DiffOverlayIcon(image, conflictDescriptor));
}
if (kind == (IRemoteSyncElement.OUTGOING | IRemoteSyncElement.ADDITION)) {
IResource resource = node.getResource();
@@ -163,7 +169,7 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
try {
ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
if (cvsFile.getSyncInfo() == null) {
- return iconCache.getImageFor(new DiffOverlayIcon(image, questionableDescriptor));
+ return iconCache.getImageFor(new DiffOverlayIcon(image, questionableDescriptor));
}
} catch (TeamException e) {
ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());

Back to the top