You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(44) |
Mar
(19) |
Apr
(113) |
May
(61) |
Jun
(133) |
Jul
(1) |
Aug
(13) |
Sep
(84) |
Oct
(23) |
Nov
(43) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
(19) |
Apr
(12) |
May
(3) |
Jun
(7) |
Jul
|
Aug
(13) |
Sep
|
Oct
|
Nov
(64) |
Dec
(10) |
| 2006 |
Jan
|
Feb
(19) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(22) |
Sep
(13) |
Oct
(9) |
Nov
(19) |
Dec
(2) |
| 2008 |
Jan
(64) |
Feb
|
Mar
(69) |
Apr
|
May
(5) |
Jun
(6) |
Jul
(4) |
Aug
(47) |
Sep
(16) |
Oct
(15) |
Nov
(27) |
Dec
(45) |
| 2009 |
Jan
(81) |
Feb
(37) |
Mar
(8) |
Apr
(4) |
May
(6) |
Jun
(39) |
Jul
(53) |
Aug
(17) |
Sep
(14) |
Oct
(6) |
Nov
|
Dec
(46) |
| 2010 |
Jan
(2) |
Feb
(204) |
Mar
(86) |
Apr
(20) |
May
(9) |
Jun
|
Jul
(18) |
Aug
(31) |
Sep
(10) |
Oct
(9) |
Nov
(34) |
Dec
(35) |
| 2011 |
Jan
|
Feb
(5) |
Mar
(22) |
Apr
(29) |
May
|
Jun
(29) |
Jul
(7) |
Aug
(23) |
Sep
(53) |
Oct
(45) |
Nov
(72) |
Dec
(28) |
| 2012 |
Jan
(17) |
Feb
(23) |
Mar
(8) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Mikael P. <er...@us...> - 2012-02-15 14:02:11
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions
In directory vz-cvs-4.sog:/tmp/cvs-serv26596/src/net/sourceforge/eclipseccase/ui/actions
Modified Files:
Tag: mike_diff_checkin
MCheckinAction.java
Log Message:
First version of new checkin dialog.
Index: MCheckinAction.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions/Attic/MCheckinAction.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** MCheckinAction.java 10 Feb 2012 15:25:08 -0000 1.1.2.2
--- MCheckinAction.java 15 Feb 2012 14:02:08 -0000 1.1.2.3
***************
*** 12,15 ****
--- 12,21 ----
package net.sourceforge.eclipseccase.ui.actions;
+ import net.sourceforge.eclipseccase.ClearDlgHelper;
+
+ import net.sourceforge.eclipseccase.ClearCasePreferences;
+
+ import org.eclipse.core.resources.IFile;
+
import org.eclipse.jface.wizard.WizardDialog;
***************
*** 36,90 ****
/*
! * @see CVSAction#execute(IAction)
*/
@Override
- // public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- //
- // IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- //
- // public void run(IProgressMonitor monitor) throws CoreException {
- //
- // try {
- // IResource[] resources = getSelectedResources();
- // if (resources.length > 0) {
- // beginTask(monitor, "Checking in...", resources.length);
- //
- // if (ClearCasePreferences.isUseClearDlg()) {
- // monitor.subTask("Executing ClearCase user interface...");
- // ClearDlgHelper.checkin(resources);
- // } else {
- //
- // // Sort resources with directories last so that
- // // the
- // // modification of a
- // // directory doesn't abort the modification of
- // // files
- // // within it.
- // Arrays.sort(resources, new DirectoryLastComparator());
- //
- // CheckinWizard wizard = new CheckinWizard(resources);
- // WizardDialog dialog = new WizardDialog(getShell(), wizard);
- // //wizard.setParentDialog(dialog);
- // boolean commitOK = (dialog.open() == WizardDialog.OK);
- //
- // }
- // }
- // } finally {
- // monitor.done();
- // updateActionEnablement();
- // }
- // }
- // };
- //
- // executeInBackground(runnable, "Checking in ClearCase resources");
- // }
-
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
! IResource[] resources = getSelectedResources();
! if (resources.length > 0) {
! ClearCaseProvider provider = new ClearCaseProvider();
! CheckinWizard wizard = new CheckinWizard(resources,provider);
! WizardDialog dialog = new WizardDialog(getShell(), wizard);
! dialog.open();
}
}
--- 42,82 ----
/*
! * @see TeamAction#execute(IAction)
*/
@Override
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
! boolean canContinue = true;
! // prompt for saving dirty editors
! IFile[] unsavedFiles = getUnsavedFiles();
! if (unsavedFiles.length > 0) {
! canContinue = saveModifiedResourcesIfUserConfirms(unsavedFiles);
! }
!
! if (canContinue) {
!
! final IResource[] resources = getSelectedResources();
! if (resources.length > 0) {
! if (ClearCasePreferences.isUseClearDlg()) {
!
! IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
! public void run(IProgressMonitor monitor) throws CoreException {
! try {
! monitor.subTask("Executing ClearCase user interface...");
! ClearDlgHelper.checkin(resources);
! } finally {
! monitor.done();
! updateActionEnablement();
! }
! }
! };
! executeInBackground(runnable, "Checking in ClearCase resources");
! } else {
!
! ClearCaseProvider provider = new ClearCaseProvider();
! CheckinWizard wizard = new CheckinWizard(resources, provider);
! WizardDialog dialog = new WizardDialog(getShell(), wizard);
! dialog.open();
! }
! }
}
}
|
|
From: Mikael P. <er...@us...> - 2012-02-14 13:35:54
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase
In directory vz-cvs-4.sog:/tmp/cvs-serv17879/src/net/sourceforge/eclipseccase
Modified Files:
StateCacheFactory.java
Log Message:
Fix for bug 3487493.
Index: StateCacheFactory.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/StateCacheFactory.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** StateCacheFactory.java 14 Nov 2011 12:09:49 -0000 1.54
--- StateCacheFactory.java 14 Feb 2012 13:35:51 -0000 1.55
***************
*** 681,685 ****
for (int i = 0; i < projectDeltas.length; i++) {
IResourceDelta projectDelta = projectDeltas[i];
!
// filter only shared projects
if (RepositoryProvider.isShared((IProject) projectDelta
--- 681,691 ----
for (int i = 0; i < projectDeltas.length; i++) {
IResourceDelta projectDelta = projectDeltas[i];
!
! //Fix for bug 3487493.
! //check if the resource is attached to clearcase if not continue with next resource
! //this is to avoid projects shared with other repository.
! if(ClearCaseProvider.getClearCaseProvider(projectDelta.getResource()) == null)
! continue;
!
// filter only shared projects
if (RepositoryProvider.isShared((IProject) projectDelta
|
|
From: Mikael P. <er...@us...> - 2012-02-10 15:25:11
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions
In directory vz-cvs-4.sog:/tmp/cvs-serv31920/src/net/sourceforge/eclipseccase/ui/actions
Modified Files:
Tag: mike_diff_checkin
MCheckinAction.java
Log Message:
First version of new checkin dialog.
Index: MCheckinAction.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions/Attic/MCheckinAction.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** MCheckinAction.java 27 Jan 2012 14:54:57 -0000 1.1.2.1
--- MCheckinAction.java 10 Feb 2012 15:25:08 -0000 1.1.2.2
***************
*** 83,87 ****
IResource[] resources = getSelectedResources();
if (resources.length > 0) {
! CheckinWizard wizard = new CheckinWizard(resources);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.open();
--- 83,88 ----
IResource[] resources = getSelectedResources();
if (resources.length > 0) {
! ClearCaseProvider provider = new ClearCaseProvider();
! CheckinWizard wizard = new CheckinWizard(resources,provider);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.open();
|
|
From: Mikael P. <er...@us...> - 2012-02-02 15:56:51
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui
In directory vz-cvs-4.sog:/tmp/cvs-serv13346/src/net/sourceforge/eclipseccase/ui
Modified Files:
Tag: mike_diff_checkin
ElementSelectionTree.java
Log Message:
Updated
Index: ElementSelectionTree.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/Attic/ElementSelectionTree.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** ElementSelectionTree.java 1 Feb 2012 17:59:42 -0000 1.1.2.3
--- ElementSelectionTree.java 2 Feb 2012 15:56:49 -0000 1.1.2.4
***************
*** 1,56 ****
package net.sourceforge.eclipseccase.ui;
! import org.eclipse.core.resources.IWorkspaceRoot;
!
! import org.eclipse.compare.structuremergeviewer.Differencer;
!
! import org.eclipse.team.core.diff.IDiff;
!
! import org.eclipse.team.ui.synchronize.AbstractSynchronizeLabelProvider;
!
! import org.eclipse.compare.CompareConfiguration;
!
! import org.eclipse.ui.model.WorkbenchLabelProvider;
!
! import org.eclipse.jface.viewers.LabelProvider;
!
! import org.eclipse.ui.model.WorkbenchContentProvider;
! import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
-
- import org.eclipse.jface.viewers.ILabelProvider;
-
- import org.eclipse.jface.viewers.Viewer;
-
- import java.io.File;
-
- import org.eclipse.jface.viewers.ITreeContentProvider;
-
- import org.eclipse.core.resources.IContainer;
-
- import org.eclipse.jface.viewers.CheckStateChangedEvent;
-
- import java.util.Comparator;
-
- import java.util.ArrayList;
-
- import java.util.Arrays;
-
- import org.eclipse.core.resources.IResource;
-
- import org.eclipse.jface.viewers.ICheckStateListener;
-
import org.eclipse.swt.layout.GridData;
-
- import org.eclipse.jface.viewers.CheckboxTreeViewer;
-
import org.eclipse.swt.layout.GridLayout;
-
- import org.eclipse.swt.SWT;
-
- import org.eclipse.swt.widgets.Control;
-
import org.eclipse.swt.widgets.Composite;
/**
--- 1,16 ----
package net.sourceforge.eclipseccase.ui;
! import org.eclipse.swt.custom.ViewForm;
! import java.util.*;
! import org.eclipse.core.resources.*;
! import org.eclipse.jface.viewers.*;
! import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+ import org.eclipse.ui.model.WorkbenchContentProvider;
+ import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
***************
*** 86,95 ****
}
! protected Control createContents(Composite parent) {
! Composite composite = new Composite(parent, SWT.NONE);
! composite.setLayout(new GridLayout(1, false));
!
// Create the tree viewer to display the file tree
! final CheckboxTreeViewer checkTreeViewer = new CheckboxTreeViewer(composite);
checkTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
checkTreeViewer.setContentProvider(new ElementSelectionContentProvider());
--- 46,58 ----
}
! private void createContents(Composite parent) {
! // Composite composite = new Composite(parent, SWT.NONE);
! // composite.setLayout(new GridLayout(1, false));
! ViewForm viewerPane = new ViewForm(this, SWT.BORDER | SWT.FLAT);
! viewerPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
!
!
// Create the tree viewer to display the file tree
! final CheckboxTreeViewer checkTreeViewer = new CheckboxTreeViewer(viewerPane,SWT.MULTI);
checkTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
checkTreeViewer.setContentProvider(new ElementSelectionContentProvider());
***************
*** 106,118 ****
}
});
! return composite;
}
public IResource[] getSelectedResources() {
ArrayList<IResource> selected = new ArrayList<IResource>();
! Object[] checkedResources = ((CheckboxTreeViewer) checkTreeViewer).getCheckedElements();
for (int i = 0; i < checkedResources.length; i++) {
! if (resourceList.contains(checkedResources[i]))
selected.add((IResource) checkedResources[i]);
}
IResource[] selectedResources = new IResource[selected.size()];
--- 69,82 ----
}
});
!
}
public IResource[] getSelectedResources() {
ArrayList<IResource> selected = new ArrayList<IResource>();
! Object[] checkedResources = checkTreeViewer.getCheckedElements();
for (int i = 0; i < checkedResources.length; i++) {
! if (resourceList.contains(checkedResources[i])) {
selected.add((IResource) checkedResources[i]);
+ }
}
IResource[] selectedResources = new IResource[selected.size()];
***************
*** 131,138 ****
--- 95,104 ----
// we only use compressed mode!
private class ElementSelectionContentProvider extends WorkbenchContentProvider {
+ @Override
public Object getParent(Object element) {
return ((IResource) element).getParent();
}
+ @Override
public boolean hasChildren(Object element) {
if (element instanceof IContainer)
***************
*** 142,156 ****
}
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
public Object[] getChildren(Object parentElement) {
! if (parentElement instanceof ElementSelectionTree) {
return getCompressedFolders();
! }
! if (parentElement instanceof IContainer) {
return getChildResources((IContainer) parentElement);
- }
return new Object[0];
}
--- 108,122 ----
}
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
+ @Override
public Object[] getChildren(Object parentElement) {
! if (parentElement instanceof ElementSelectionTree)
return getCompressedFolders();
! if (parentElement instanceof IContainer)
return getChildResources((IContainer) parentElement);
return new Object[0];
}
***************
*** 160,163 ****
--- 126,130 ----
WorkbenchLabelProvider wlp = new WorkbenchLabelProvider();
+ @Override
public Image getImage(Object element) {
Image image = null;
***************
*** 176,179 ****
--- 143,147 ----
}
+ @Override
public String getText(Object element) {
String text = null;
***************
*** 182,187 ****
IContainer container = (IContainer) element;
text = container.getFullPath().makeRelative().toString();
! } else
text = resource.getName();
return text;
--- 150,156 ----
IContainer container = (IContainer) element;
text = container.getFullPath().makeRelative().toString();
! } else {
text = resource.getName();
+ }
return text;
***************
*** 194,199 ****
compressedFolderList = new ArrayList<IResource>();
for (int i = 0; i < resources.length; i++) {
! if (resources[i] instanceof IContainer && !compressedFolderList.contains(resources[i]))
compressedFolderList.add(resources[i]);
if (!(resources[i] instanceof IContainer)) {
IContainer parent = resources[i].getParent();
--- 163,169 ----
compressedFolderList = new ArrayList<IResource>();
for (int i = 0; i < resources.length; i++) {
! if (resources[i] instanceof IContainer && !compressedFolderList.contains(resources[i])) {
compressedFolderList.add(resources[i]);
+ }
if (!(resources[i] instanceof IContainer)) {
IContainer parent = resources[i].getParent();
***************
*** 215,220 ****
if (!(resources[i] instanceof IContainer)) {
IContainer parentFolder = resources[i].getParent();
! if (parentFolder != null && parentFolder.equals(parent) && !children.contains(parentFolder))
children.add(resources[i]);
}
}
--- 185,191 ----
if (!(resources[i] instanceof IContainer)) {
IContainer parentFolder = resources[i].getParent();
! if (parentFolder != null && parentFolder.equals(parent) && !children.contains(parentFolder)) {
children.add(resources[i]);
+ }
}
}
|
|
From: Mikael P. <er...@us...> - 2012-02-01 17:59:45
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui
In directory vz-cvs-4.sog:/tmp/cvs-serv10238/src/net/sourceforge/eclipseccase/ui
Modified Files:
Tag: mike_diff_checkin
ElementSelectionTree.java
Log Message:
Additional update
Index: ElementSelectionTree.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/Attic/ElementSelectionTree.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** ElementSelectionTree.java 1 Feb 2012 14:19:00 -0000 1.1.2.2
--- ElementSelectionTree.java 1 Feb 2012 17:59:42 -0000 1.1.2.3
***************
*** 68,74 ****
private CheckboxTreeViewer checkTreeViewer;
!
private IContainer[] compressedFolders;
!
private ArrayList<IResource> compressedFolderList;
--- 68,74 ----
private CheckboxTreeViewer checkTreeViewer;
!
private IContainer[] compressedFolders;
!
private ArrayList<IResource> compressedFolderList;
***************
*** 114,118 ****
for (int i = 0; i < checkedResources.length; i++) {
if (resourceList.contains(checkedResources[i]))
! selected.add((IResource)checkedResources[i]);
}
IResource[] selectedResources = new IResource[selected.size()];
--- 114,118 ----
for (int i = 0; i < checkedResources.length; i++) {
if (resourceList.contains(checkedResources[i]))
! selected.add((IResource) checkedResources[i]);
}
IResource[] selectedResources = new IResource[selected.size()];
***************
*** 158,242 ****
private class ElementSelectionLabelProvider extends LabelProvider {
! private WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
!
! private CompareConfiguration compareConfiguration = new CompareConfiguration();
!
! private AbstractSynchronizeLabelProvider syncLabelProvider = new AbstractSynchronizeLabelProvider() {
! protected ILabelProvider getDelegateLabelProvider() {
! return workbenchLabelProvider;
! }
! protected boolean isDecorationEnabled() {
! return true;
! }
- protected IDiff getDiff(Object element) {
- IResource resource = (IResource) element;
- return null;
- //return new ResourceSelectionDiff(resource);
}
! };
- public Image getImage(Object element) {
- if (resourceList.contains(element)) {
- IResource resource = (IResource) element;
- Image image = null;
- if (resource instanceof IContainer && !resource.isAccessible()) {
- image = workbenchLabelProvider.getImage(element);
- image = compareConfiguration.getImage(image, Differencer.NO_CHANGE);
- } else {
- // if (statusKind != null) {
- // if (statusKind.hasTreeConflict()) {
- // image = workbenchLabelProvider.getImage(element);
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.TREE_CONFLICT);
- // } else if (statusKind != null && statusKind.equals(SVNStatusKind.CONFLICTED)) {
- // image = workbenchLabelProvider.getImage(element);
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.TEXT_CONFLICTED);
- // }
- // }
- if (image == null)
- image = syncLabelProvider.getImage(element);
- if (element instanceof IContainer)
- return image;
- // if (unversionedResourceList.contains(element)) {
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.UNVERSIONED);
- // }
- // if (statusKind != null && statusKind.equals(SVNStatusKind.MISSING)) {
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.MISSING);
- // }
- }
- // String propertyStatus = ResourceWithStatusUtil.getPropertyStatus((IResource) element);
- // if (propertyStatus != null && propertyStatus.length() > 0) {
- // if (propertyStatus.equals("conflicted")) //$NON-NLS-1$
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.PROPERTY_CONFLICTED);
- // else
- // image = resourceSelectionTreeDecorator.getImage(image, ResourceSelectionTreeDecorator.PROPERTY_CHANGE);
- }
- // return image;
- // } else {
- // Image image = workbenchLabelProvider.getImage(element);
- // return compareConfiguration.getImage(image, Differencer.NO_CHANGE);
- // }
- return null;
-
-
}
public String getText(Object element) {
-
- // if (statusMap == null)
- // return workbenchLabelProvider.getText(element);
String text = null;
IResource resource = (IResource) element;
! // if (mode == MODE_FLAT)
! // text = resource.getName() + " - " + resource.getFullPath().toString(); //$NON-NLS-1$
! if (element instanceof IContainer) {
! IContainer container = (IContainer) element;
! text = container.getFullPath().makeRelative().toString();
! } else
! text = resource.getName();
!
return text;
}
--- 158,188 ----
private class ElementSelectionLabelProvider extends LabelProvider {
! WorkbenchLabelProvider wlp = new WorkbenchLabelProvider();
! public Image getImage(Object element) {
! Image image = null;
! if (resourceList.contains(element)) {
! if (element instanceof IContainer) {
! image = wlp.getImage(element);
! } else {
! image = wlp.getImage(element);
! }
}
! return image;
}
public String getText(Object element) {
String text = null;
IResource resource = (IResource) element;
! if (element instanceof IContainer) {
! IContainer container = (IContainer) element;
! text = container.getFullPath().makeRelative().toString();
! } else
! text = resource.getName();
!
return text;
}
***************
*** 263,267 ****
return compressedFolders;
}
!
private IResource[] getChildResources(IContainer parent) {
ArrayList<IResource> children = new ArrayList<IResource>();
--- 209,213 ----
return compressedFolders;
}
!
private IResource[] getChildResources(IContainer parent) {
ArrayList<IResource> children = new ArrayList<IResource>();
|
|
From: Mikael P. <er...@us...> - 2012-02-01 14:19:02
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards
In directory vz-cvs-4.sog:/tmp/cvs-serv19820/src/net/sourceforge/eclipseccase/ui/wizards
Modified Files:
Tag: mike_diff_checkin
CheckinWizardPage.java
Log Message:
Updates for checkin diff.
Index: CheckinWizardPage.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards/Attic/CheckinWizardPage.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** CheckinWizardPage.java 27 Jan 2012 14:54:57 -0000 1.1.2.1
--- CheckinWizardPage.java 1 Feb 2012 14:19:00 -0000 1.1.2.2
***************
*** 1,4 ****
--- 1,6 ----
package net.sourceforge.eclipseccase.ui.wizards;
+ import net.sourceforge.eclipseccase.ui.ElementSelectionTree;
+
import org.eclipse.swt.custom.SashForm;
***************
*** 53,56 ****
--- 55,60 ----
private Combo previousCommentsCombo;
+
+ private ElementSelectionTree selectionTree;
/**
***************
*** 123,127 ****
SashForm horizontalSash = new SashForm(container, SWT.HORIZONTAL|SWT.SMOOTH);
horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
!
//Add changed resource area.
--- 127,131 ----
SashForm horizontalSash = new SashForm(container, SWT.HORIZONTAL|SWT.SMOOTH);
horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
! selectionTree = new ElementSelectionTree(horizontalSash, resource, SWT.NONE);
//Add changed resource area.
|
|
From: Mikael P. <er...@us...> - 2012-02-01 11:43:29
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase
In directory vz-cvs-4.sog:/tmp/cvs-serv1808/src/net/sourceforge/eclipseccase
Modified Files:
ClearCaseProvider.java
Log Message:
Fix for UCM.
Index: ClearCaseProvider.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/ClearCaseProvider.java,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** ClearCaseProvider.java 13 Jan 2012 13:43:23 -0000 1.77
--- ClearCaseProvider.java 1 Feb 2012 11:43:27 -0000 1.78
***************
*** 421,424 ****
--- 421,429 ----
*/
public boolean isCheckedOutInAnyView(String element) {
+ //UCM we do not need to know of another stream co.
+ if(ClearCasePreferences.isUCM()){
+ return false;
+ }
+
boolean isCheckedoutInOtherView = false;
checkedOutInOtherView.clear();
***************
*** 432,436 ****
Pattern pattern = Pattern.compile(".*View:\\s(.*)\\sStatus:.*");
! if (output.length > 0) {
// we have file checked-out in other view.
isCheckedoutInOtherView = true;
--- 437,441 ----
Pattern pattern = Pattern.compile(".*View:\\s(.*)\\sStatus:.*");
! if (output.length > 0 ) {
// we have file checked-out in other view.
isCheckedoutInOtherView = true;
***************
*** 789,793 ****
IStatus result = OK_STATUS;
ClearCaseElementState[] state = null;
!
if (isCheckedOutInAnyView(source.getLocation().toOSString())) {
--- 794,798 ----
IStatus result = OK_STATUS;
ClearCaseElementState[] state = null;
!
if (isCheckedOutInAnyView(source.getLocation().toOSString())) {
***************
*** 803,820 ****
+ " Do you still want to move, "
+ source.getName() + "?");
!
! }
! // If not 1 ( ok) then we cancel operation.
! if (returnCode != 0) {
! return new Status(
! IStatus.ERROR,
! ID,
! TeamException.CONFLICT,
! MessageFormat
! .format(
! "Cancelled move operation for \"{0}\"!",
! new Object[] { source.getFullPath()
! .toString() }), null);
}
if (ClearCasePreferences.isAutoCheckinParentAfterMoveAllowed()) {
--- 808,816 ----
+ " Do you still want to move, "
+ source.getName() + "?");
! if(returnCode != 0){
! return cancelCheckout(source,monitor, opListener);
! }
}
+
if (ClearCasePreferences.isAutoCheckinParentAfterMoveAllowed()) {
***************
*** 2389,2392 ****
--- 2385,2413 ----
ClearCasePlugin.getEngine().get(ClearCase.TO, args, versionToCopy);
}
+
+ /**
+ * Method is used for a rename refactoring when the file to be renamed have been checkedout.
+ * When the file is checked out in another view and the user don't want to proceed we cancel checkout
+ * and return fail status. This is due to undo operation is not working.
+ * @param resource
+ * @param monitor
+ * @param opListener
+ * @return
+ */
+ private IStatus cancelCheckout(IResource resource,IProgressMonitor monitor,OperationListener opListener){
+ //uncheckout since we do not want to checkout.
+ ClearCasePlugin.getEngine().uncheckout(new String[] { resource.getLocation().toOSString() }, ClearCase.NONE, opListener);
+ updateState(resource, IResource.DEPTH_ZERO,
+ new SubProgressMonitor(monitor, 10));
+ return new Status(
+ IStatus.ERROR,
+ ID,
+ TeamException.CONFLICT,
+ MessageFormat
+ .format(
+ "Cancelled move operation for \"{0}\"!",
+ new Object[] { resource.getFullPath()
+ .toString() }), null);
+ }
}
|
|
From: Mikael P. <er...@us...> - 2012-01-27 14:55:01
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui
In directory vz-cvs-4.sog:/tmp/cvs-serv18032
Modified Files:
Tag: mike_diff_checkin
plugin.xml
Log Message:
First version of new checkin
Index: plugin.xml
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/plugin.xml,v
retrieving revision 1.58
retrieving revision 1.58.2.1
diff -C2 -d -r1.58 -r1.58.2.1
*** plugin.xml 21 Nov 2011 13:53:30 -0000 1.58
--- plugin.xml 27 Jan 2012 14:54:57 -0000 1.58.2.1
***************
*** 95,98 ****
--- 95,103 ----
label="Checkout" menubarPath="team.main/group1">
</action>
+ <!-- Testing new action -->
+ <action class="net.sourceforge.eclipseccase.ui.actions.MCheckinAction"
+ icon="icons/full/checkin.png" id="net.sourceforge.eclipseccase.popups.mcheckin"
+ label="Checkin Test" menubarPath="team.main/group1">
+ </action>
<action
class="net.sourceforge.eclipseccase.ui.actions.ExternalUpdateAction"
***************
*** 768,771 ****
repositoryId="net.sourceforge.eclipseccase.ClearcaseProvider" />
</extension>
!
</plugin>
--- 773,776 ----
repositoryId="net.sourceforge.eclipseccase.ClearcaseProvider" />
</extension>
!
</plugin>
|
|
From: Mikael P. <er...@us...> - 2012-01-27 14:55:00
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui
In directory vz-cvs-4.sog:/tmp/cvs-serv18032/src/net/sourceforge/eclipseccase/ui
Added Files:
Tag: mike_diff_checkin
ElementSelectionTree.java
Log Message:
First version of new checkin
--- NEW FILE: ElementSelectionTree.java ---
package net.sourceforge.eclipseccase.ui;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.Viewer;
import java.io.File;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import java.util.Comparator;
import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Composite;
/**
*
* @author mikael petterson
*
*/
public class ElementSelectionTree extends Composite {
private ArrayList resourceList;
private IResource[] resources;
private ResourceComparator comparator = new ResourceComparator();
private CheckboxTreeViewer checkTreeViewer;
public ElementSelectionTree(Composite parent, IResource[] resources, int style) {
super(parent, style);
this.resources = resources;
// sort and add to internal holder.
Arrays.sort(resources, comparator);
resourceList = new ArrayList();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
resourceList.add(resource);
}
}
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
// Create the tree viewer to display the file tree
final CheckboxTreeViewer checkTreeViewer = new CheckboxTreeViewer(composite);
checkTreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
checkTreeViewer.setContentProvider(new FileTreeContentProvider());
checkTreeViewer.setLabelProvider(new FileTreeLabelProvider());
checkTreeViewer.setInput("root"); // pass a non-null that will be
// ignored
// When user checks a checkbox in the tree, check all its children
checkTreeViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (event.getChecked()) {
checkTreeViewer.setSubtreeChecked(event.getElement(), true);
}
}
});
return composite;
}
public IResource[] getSelectedResources() {
ArrayList selected = new ArrayList();
Object[] checkedResources = ((CheckboxTreeViewer) checkTreeViewer).getCheckedElements();
for (int i = 0; i < checkedResources.length; i++) {
if (resourceList.contains(checkedResources[i]))
selected.add(checkedResources[i]);
}
IResource[] selectedResources = new IResource[selected.size()];
selected.toArray(selectedResources);
return selectedResources;
}
private class ResourceComparator implements Comparator {
public int compare(Object objA, Object objB) {
IResource resourceA = (IResource) objA;
IResource resourceB = (IResource) objB;
return resourceA.getFullPath().toOSString().compareTo(resourceB.getFullPath().toOSString());
}
}
class FileTreeContentProvider implements ITreeContentProvider {
public Object[] getChildren(Object arg0) {
return ((File) arg0).listFiles();
}
public Object getParent(Object arg0) {
return ((File) arg0).getParentFile();
}
public boolean hasChildren(Object arg0) {
Object[] obj = getChildren(arg0);
return obj == null ? false : obj.length > 0;
}
public Object[] getElements(Object arg0) {
return File.listRoots();
}
public void dispose() {
}
public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
}
}
class FileTreeLabelProvider implements ILabelProvider {
private Image file;
private Image dir;
public FileTreeLabelProvider() {
}
public Image getImage(Object arg0) {
// TODO Auto-generated method stub
return null;
}
public String getText(Object arg0) {
// TODO Auto-generated method stub
return null;
}
public void addListener(ILabelProviderListener arg0) {
// TODO Auto-generated method stub
}
public void dispose() {
// TODO Auto-generated method stub
}
public boolean isLabelProperty(Object arg0, String arg1) {
// TODO Auto-generated method stub
return false;
}
public void removeListener(ILabelProviderListener arg0) {
// TODO Auto-generated method stub
}
}
}
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards
In directory vz-cvs-4.sog:/tmp/cvs-serv18032/src/net/sourceforge/eclipseccase/ui/wizards
Added Files:
Tag: mike_diff_checkin
CheckinWizardPage.java message.properties ResizableWizard.java
CheckinWizard.java
Log Message:
First version of new checkin
--- NEW FILE: ResizableWizard.java ---
/*******************************************************************************
* Copyright (c) 2004, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package net.sourceforge.eclipseccase.ui.wizards;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.Wizard;
public class ResizableWizard extends Wizard {
private final int DEFAULT_WIDTH;
private final int DEFAULT_HEIGHT;
private static final String BOUNDS_HEIGHT_KEY = "width"; //$NON-NLS-1$
private static final String BOUNDS_WIDTH_KEY = "height"; //$NON-NLS-1$
final String fSectionName;
public ResizableWizard(String sectionName, IDialogSettings settings) {
this(sectionName, settings, 300, 400);
}
protected ResizableWizard(String sectionName, IDialogSettings settings, int defaultWidth, int defaultHeight) {
DEFAULT_WIDTH= defaultWidth;
DEFAULT_HEIGHT= defaultHeight;
fSectionName= sectionName;
setDialogSettings(settings);
}
protected static int open(Shell shell, ResizableWizard wizard) {
final WizardDialog dialog= new WizardDialog(shell, wizard);
dialog.setMinimumPageSize(wizard.loadSize());
return dialog.open();
}
public void saveSize() {
final Rectangle bounds= getContainer().getCurrentPage().getControl().getParent().getClientArea();
final IDialogSettings settings= getDialogSettings();
if (settings == null)
return;
IDialogSettings section= settings.getSection(fSectionName);
if (section == null)
section= settings.addNewSection(fSectionName);
section.put(BOUNDS_WIDTH_KEY, bounds.width);
section.put(BOUNDS_HEIGHT_KEY, bounds.height);
}
public Point loadSize() {
final Point size= new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
final IDialogSettings settings= getDialogSettings();
if (settings == null)
return size;
final IDialogSettings section= settings.getSection(fSectionName);
if (section == null)
return size;
try {
size.x= section.getInt(BOUNDS_WIDTH_KEY);
size.y= section.getInt(BOUNDS_HEIGHT_KEY);
} catch (NumberFormatException e) {
}
return size;
}
public boolean performFinish() {
saveSize();
return true;
}
}
--- NEW FILE: CheckinWizard.java ---
package net.sourceforge.eclipseccase.ui.wizards;
import net.sourceforge.eclipseccase.ui.ClearCaseUI;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.core.runtime.*;
import org.eclipse.jface.operation.*;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import java.io.*;
import org.eclipse.ui.*;
import org.eclipse.ui.ide.IDE;
/**
* This is a sample new wizard. Its role is to create a new file
* resource in the provided container. If the container resource
* (a folder or a project) is selected in the workspace
* when the wizard is opened, it will accept it as the target
* container. The wizard creates one file with the extension
* "mpe". If a sample multi-page editor (also available
* as a template) is registered for the same extension, it will
* be able to open it.
*/
public class CheckinWizard extends ResizableWizard implements INewWizard {
private CheckinWizardPage page;
private IResource [] resources;
private IStructuredSelection selection;
public static final String CHECKIN_WIZARD_DIALOG_SETTINGS = "CheckinWizard"; //$NON-NLS-1$
/**
* Constructor for SampleNewWizard.
*/
public CheckinWizard(IResource [] resources) {
//FIXME:mike changed to ResizableWizard.
super(CHECKIN_WIZARD_DIALOG_SETTINGS,ClearCaseUI.getInstance().getDialogSettings());
setNeedsProgressMonitor(true);
this.resources = resources;
}
/**
* Adding the page to the wizard.
*/
public void addPages() {
page = new CheckinWizardPage(resources);
addPage(page);
}
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
* using wizard as execution context.
*/
public boolean performFinish() {
final String containerName = page.getContainerName();
final String fileName = page.getFileName();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
doFinish(containerName, fileName, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
};
try {
getContainer().run(true, false, op);
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
MessageDialog.openError(getShell(), "Error", realException.getMessage());
return false;
}
return true;
}
/**
* The worker method. It will find the container, create the
* file if missing or just replace its contents, and open
* the editor on the newly created file.
*/
private void doFinish(
String containerName,
String fileName,
IProgressMonitor monitor)
throws CoreException {
// create a sample file
monitor.beginTask("Creating " + fileName, 2);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = root.findMember(new Path(containerName));
if (!resource.exists() || !(resource instanceof IContainer)) {
throwCoreException("Container \"" + containerName + "\" does not exist.");
}
IContainer container = (IContainer) resource;
final IFile file = container.getFile(new Path(fileName));
try {
InputStream stream = openContentStream();
if (file.exists()) {
file.setContents(stream, true, true, monitor);
} else {
file.create(stream, true, monitor);
}
stream.close();
} catch (IOException e) {
}
monitor.worked(1);
monitor.setTaskName("Opening file for editing...");
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IDE.openEditor(page, file, true);
} catch (PartInitException e) {
}
}
});
monitor.worked(1);
}
/**
* We will initialize file contents with a sample text.
*/
private InputStream openContentStream() {
String contents =
"This is the initial file contents for *.mpe file that should be word-sorted in the Preview page of the multi-page editor";
return new ByteArrayInputStream(contents.getBytes());
}
private void throwCoreException(String message) throws CoreException {
IStatus status =
new Status(IStatus.ERROR, "Test", IStatus.OK, message, null);
throw new CoreException(status);
}
/**
* We will accept the selection in the workbench to see if
* we can initialize from it.
* @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
}
}
--- NEW FILE: CheckinWizardPage.java ---
package net.sourceforge.eclipseccase.ui.wizards;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Composite;
import net.sourceforge.eclipseccase.ui.CommentDialogArea;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import java.io.File;
import net.sourceforge.clearcase.ClearCase;
import net.sourceforge.eclipseccase.ClearCasePlugin;
import net.sourceforge.eclipseccase.ClearCaseProvider;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
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.ui.dialogs.ContainerSelectionDialog;
/**
* The "New" wizard page allows setting the container for the new file as well
* as the file name. The page will only accept file name without the extension
* OR with the extension that matches the expected one (mpe).
*/
public class CheckinWizardPage extends WizardPage {
private Text containerText;
private Text commentText;
private String comment;
String[] comments = new String[0];
private Text fileText;
private static final int WIDTH_HINT = 350;
private static final int HEIGHT_HINT = 150;
private IResource[] resource;
private Combo previousCommentsCombo;
/**
* Constructor for SampleNewWizardPage.
*
* @param pageName
*/
public CheckinWizardPage(IResource[] resource) {
super("wizardPage");
setTitle("Checkin");
setDescription("No useful title here yet!");
this.resource = resource;
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
Composite container = createGrabbingComposite(parent, 1);
setControl(container);
// START Comment
final Label commentLabel = new Label(container, SWT.NULL);
commentLabel.setText("Edit the &comment:");
commentText = new Text(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
GridData data = new GridData(GridData.FILL_BOTH);
data.widthHint = WIDTH_HINT;
data.heightHint = HEIGHT_HINT;
commentText.setLayoutData(data);
commentText.selectAll();
//Tabbing?
commentText.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_RETURN && (e.stateMask & SWT.CTRL) != 0) {
e.doit = false;
// CommentDialogArea.this.signalCtrlEnter();
}
}
});
// Combo for comments
final Label prevCommentLabel = new Label(container, SWT.NULL);
prevCommentLabel.setText("Choose a &previously entered comment:");
previousCommentsCombo = new Combo(container, SWT.READ_ONLY);
GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
data2.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
previousCommentsCombo.setLayoutData(data2);
// Initialize the values before we register any listeners so
// we don't get any platform specific selection behavior
// (see bug 32078: http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
initializeValues();
previousCommentsCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
int index = previousCommentsCombo.getSelectionIndex();
if (index != -1) {
commentText.setText(comments[index]);
}
}
});
// END Comment
SashForm horizontalSash = new SashForm(container, SWT.HORIZONTAL|SWT.SMOOTH);
horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
//Add changed resource area.
//Add a Tree viewer.
// Label label = new Label(container, SWT.NULL);
// label.setLayoutData(new GridData());
// label.setText("Edit the &comment:");
//
// GridData data = null;
//
// text = new Text(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL |
// SWT.V_SCROLL);
// data = new GridData(GridData.FILL_BOTH);
// data.widthHint = WIDTH_HINT;
// data.heightHint = HEIGHT_HINT;
// text.setLayoutData(data);
// text.selectAll();
// text.addTraverseListener(new TraverseListener() {
//
// public void keyTraversed(TraverseEvent e) {
// if (e.detail == SWT.TRAVERSE_RETURN && (e.stateMask & SWT.CTRL) != 0)
// {
// e.doit = false;
// //CommentDialogArea.this.signalCtrlEnter();
// }
// }
// });
//
// text.setText(comment);
// text.addModifyListener(new ModifyListener() {
//
// public void modifyText(ModifyEvent e) {
// comment = text.getText();
// }
// });
//
// label = new Label(container, SWT.NULL);
// label.setLayoutData(new GridData());
// label.setText("Choose a &previously entered comment:");
//
// previousCommentsCombo = new Combo(container, SWT.READ_ONLY);
// data = new GridData(GridData.FILL_HORIZONTAL);
// data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
// previousCommentsCombo.setLayoutData(data);
//
// // Initialize the values before we register any listeners so
// // we don't get any platform specific selection behavior
// // (see bug 32078:
// http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
// initializeValues();
//
// previousCommentsCombo.addSelectionListener(new SelectionAdapter() {
//
// @Override
// public void widgetSelected(SelectionEvent e) {
// int index = previousCommentsCombo.getSelectionIndex();
// if (index != -1) {
// text.setText(comments[index]);
// }
// }
// });
// END Comment
// Button button = new Button(container, SWT.PUSH);
// button.setText("Browse...");
// button.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// handleBrowse();
// }
// });
// label = new Label(container, SWT.NULL);
// label.setText("&File name:");
//
// fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
// gd = new GridData(GridData.FILL_HORIZONTAL);
// fileText.setLayoutData(gd);
// fileText.addModifyListener(new ModifyListener() {
// public void modifyText(ModifyEvent e) {
// dialogChanged();
// }
// });
//
// dialogChanged();
}
private void addComments(Composite parent) {
// String maybeComment = "";
// int maybeDepth = IResource.DEPTH_ZERO;
// CommentDialog dlg;
// if (!ClearCasePreferences.isUseClearDlg() &&
// ClearCasePreferences.isCommentCheckin()) {
// //IResource[] resources = getSelectedResources();
// String extCoComment = getLastExtCoComment(resource);
// if (!extCoComment.equalsIgnoreCase("")) {
// dlg = new CommentDialog(parent, "Checkin comment", extCoComment);
// } else {
// dlg = new CommentDialog(getShell(), "Checkin comment");
// }
// if (dlg.open() == Window.CANCEL)
// return;
// maybeComment = dlg.getComment();
// maybeComment = dlg.getComment();
// maybeDepth = dlg.isRecursive() ? IResource.DEPTH_INFINITE :
// IResource.DEPTH_ZERO;
// }
}
private void initializeValues() {
// populate the previous comment list
for (int i = 0; i < comments.length; i++) {
previousCommentsCombo.add(flattenText(comments[i]));
}
// We don't want to have an initial selection
// (see bug 32078: http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
previousCommentsCombo.setText(""); //$NON-NLS-1$
}
/**
* Uses the standard container selection dialog to choose the new value for
* the container field.
*/
private void handleBrowse() {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, "Select new file container");
if (dialog.open() == Window.OK) {
Object[] result = dialog.getResult();
if (result.length == 1) {
containerText.setText(((Path) result[0]).toString());
}
}
}
/**
* Ensures that both text fields are set.
*/
private void dialogChanged() {
IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));
String fileName = getFileName();
if (getContainerName().length() == 0) {
updateStatus("File container must be specified");
return;
}
if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
updateStatus("File container must exist");
return;
}
if (!container.isAccessible()) {
updateStatus("Project must be writable");
return;
}
if (fileName.length() == 0) {
updateStatus("File name must be specified");
return;
}
if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
updateStatus("File name must be valid");
return;
}
int dotLoc = fileName.lastIndexOf('.');
if (dotLoc != -1) {
String ext = fileName.substring(dotLoc + 1);
if (ext.equalsIgnoreCase("mpe") == false) {
updateStatus("File extension must be \"mpe\"");
return;
}
}
updateStatus(null);
}
private void updateStatus(String message) {
setErrorMessage(message);
setPageComplete(message == null);
}
public String getContainerName() {
return containerText.getText();
}
public String getFileName() {
return fileText.getText();
}
/**
* Method retrieves the check-out comment for the last modified resource
* outside the eclipse workspace.
*
* @param resources
* @return comment
*/
private String getLastExtCoComment(IResource[] resources) {
long lastModificationTime = 0L;
IResource lastModifiedResource = null;
StringBuffer comment = new StringBuffer();
String lastComment = "";
for (IResource iResource : resources) {
String path = iResource.getLocation().toOSString();
File file = new File(path);
long modificationTime = file.lastModified();
if (modificationTime == 0L) {
ClearCasePlugin.log(IStatus.WARNING, "Could not access resource," + iResource.getName(), null);
}
if (modificationTime > lastModificationTime) {
lastModificationTime = modificationTime;
lastModifiedResource = iResource;
}
}
// get comment for last modified resource.
ClearCaseProvider provider = ClearCaseProvider.getClearCaseProvider(lastModifiedResource);
if (provider != null) {
String element = lastModifiedResource.getLocation().toOSString();
String[] output = provider.describe(element, ClearCase.FORMAT, "%c");
if (output.length > 0) {
for (int i = 0; i < output.length; i++) {
comment.append(output[i] + "\n");
}
}
lastComment = comment.toString();
}
return lastComment;
}
/**
* Flatten the text in the multiline comment
*
* @param string
* @return String
*/
String flattenText(String string) {
StringBuffer buffer = new StringBuffer(string.length() + 20);
boolean skipAdjacentLineSeparator = true;
for (int i = 0; i < string.length(); i++) {
char c = string.charAt(i);
if (c == '\r' || c == '\n') {
if (!skipAdjacentLineSeparator) {
buffer.append("/");
}
skipAdjacentLineSeparator = true;
} else {
buffer.append(c);
skipAdjacentLineSeparator = false;
}
}
return buffer.toString();
}
protected Composite createGrabbingComposite(Composite parent, int numColumns) {
Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
// GridLayout
GridLayout layout = new GridLayout();
layout.numColumns = numColumns;
composite.setLayout(layout);
// GridData
GridData data = new GridData();
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
composite.setLayoutData(data);
return composite;
}
}
--- NEW FILE: message.properties ---
CommitWizard = Enter a comment for the commit operation.
|
|
From: Mikael P. <er...@us...> - 2012-01-27 14:54:54
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards In directory vz-cvs-4.sog:/tmp/cvs-serv18020/src/net/sourceforge/eclipseccase/ui/wizards Log Message: Directory /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards added to the repository --> Using per-directory sticky tag `mike_diff_checkin' |
|
From: Mikael P. <er...@us...> - 2012-01-26 07:37:38
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui
In directory vz-cvs-4.sog:/tmp/cvs-serv22001/src/net/sourceforge/eclipseccase/ui
Modified Files:
Tag: mike_undo
ClearCaseUIModificationHandler.java
Log Message:
Adaptation for undo (IUndoable interface).
Index: ClearCaseUIModificationHandler.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/ClearCaseUIModificationHandler.java,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -C2 -d -r1.20 -r1.20.2.1
*** ClearCaseUIModificationHandler.java 13 Jan 2012 13:41:55 -0000 1.20
--- ClearCaseUIModificationHandler.java 26 Jan 2012 07:37:36 -0000 1.20.2.1
***************
*** 135,139 ****
IResource file = resources[i];
monitor.subTask(file.getName());
! provider.checkout(new IResource[] { file }, IResource.DEPTH_ZERO, null);
file.refreshLocal(IResource.DEPTH_ZERO, null);
monitor.worked(i);
--- 135,139 ----
IResource file = resources[i];
monitor.subTask(file.getName());
! provider.checkout(new IResource[] { file }, IResource.DEPTH_ZERO, monitor);
file.refreshLocal(IResource.DEPTH_ZERO, null);
monitor.worked(i);
|
|
From: Mikael P. <er...@us...> - 2012-01-26 07:37:35
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase
In directory vz-cvs-4.sog:/tmp/cvs-serv21991/src/net/sourceforge/eclipseccase
Modified Files:
Tag: mike_undo
ClearCaseProvider.java
Added Files:
Tag: mike_undo
CheckOutOperation.java
Log Message:
Adaptation for undo (IUndoable interface).
Index: ClearCaseProvider.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/ClearCaseProvider.java,v
retrieving revision 1.77
retrieving revision 1.77.2.1
diff -C2 -d -r1.77 -r1.77.2.1
*** ClearCaseProvider.java 13 Jan 2012 13:43:23 -0000 1.77
--- ClearCaseProvider.java 26 Jan 2012 07:37:33 -0000 1.77.2.1
***************
*** 27,30 ****
--- 27,35 ----
import net.sourceforge.eclipseccase.ClearCasePreferences;
+ import org.eclipse.core.commands.ExecutionException;
+ import org.eclipse.core.commands.operations.IOperationHistory;
+ import org.eclipse.core.commands.operations.IUndoContext;
+ import org.eclipse.core.commands.operations.IUndoableOperation;
+ import org.eclipse.core.commands.operations.OperationHistoryFactory;
import org.eclipse.core.resources.*;
import org.eclipse.core.resources.team.FileModificationValidator;
***************
*** 34,37 ****
--- 39,43 ----
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
+ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
***************
*** 177,185 ****
public void checkout(IResource[] resources, int depth,
IProgressMonitor progress) throws TeamException {
! try {
! execute(CHECKOUT, resources, depth, progress);
! } finally {
! setComment("");
! }
}
--- 183,211 ----
public void checkout(IResource[] resources, int depth,
IProgressMonitor progress) throws TeamException {
!
! IUndoableOperation operation = new net.sourceforge.eclipseccase.CheckOutOperation(this,"checkout",resources, depth);
! IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory();
!
! IWorkbench wb = PlatformUI.getWorkbench();
! IUndoContext undoContext = wb.getOperationSupport().getUndoContext();
! operation.addContext(undoContext);
!
!
!
! try {
! operationHistory.execute(operation,progress,null);
! } catch (ExecutionException e) {
! // TODO Auto-generated catch block
! e.printStackTrace();
! }finally {
! setComment("");
! }
!
!
! // try {
! // execute(CHECKOUT, resources, depth, progress);
! // } finally {
! // setComment("");
! // }
}
***************
*** 2258,2262 ****
}
! private int getCheckoutType() {
if (ClearCasePreferences.isReservedCheckoutsAlways())
return ClearCase.RESERVED;
--- 2284,2288 ----
}
! protected int getCheckoutType() {
if (ClearCasePreferences.isReservedCheckoutsAlways())
return ClearCase.RESERVED;
***************
*** 2350,2354 ****
* @return result
*/
! private int showMessageDialog(String operationType, String msg) {
DialogMessageRunnable dm = new DialogMessageRunnable(operationType, msg);
PlatformUI.getWorkbench().getDisplay().syncExec(dm);
--- 2376,2380 ----
* @return result
*/
! protected int showMessageDialog(String operationType, String msg) {
DialogMessageRunnable dm = new DialogMessageRunnable(operationType, msg);
PlatformUI.getWorkbench().getDisplay().syncExec(dm);
***************
*** 2363,2367 ****
* @param opListener
*/
! private void changeMastershipSequence(int returnCode,
StateCache targetElement, OperationListener opListener) {
if (returnCode == 0) {
--- 2389,2393 ----
* @param opListener
*/
! protected void changeMastershipSequence(int returnCode,
StateCache targetElement, OperationListener opListener) {
if (returnCode == 0) {
--- NEW FILE: CheckOutOperation.java ---
package net.sourceforge.eclipseccase;
import java.text.MessageFormat;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.team.core.TeamException;
import org.eclipse.ui.PlatformUI;
import net.sourceforge.clearcase.ClearCase;
import net.sourceforge.clearcase.ClearCaseException;
import net.sourceforge.eclipseccase.ClearCaseProvider.IRecursiveOperation;
public class CheckOutOperation extends AbstractOperation implements IRecursiveOperation{
public static final String ID = "net.sourceforge.eclipseccase.CheckOutOperation"; //$NON-NLS-1$
private ClearCaseProvider provider;
private IResource [] resources;
private int depth;
public CheckOutOperation(ClearCaseProvider provider,String label,IResource [] resources,int depth) {
super(label);
this.provider = provider;
this.resources = resources;
this.depth = depth;
// TODO Auto-generated constructor stub
}
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
// Create an array to hold the status for each resource.
MultiStatus multiStatus = new MultiStatus(ID, TeamException.OK,
"OK", null);
monitor.beginTask("Processing", 1000 * resources.length);
for (int i = 0; i < resources.length
&& !multiStatus.matches(IStatus.ERROR); i++) {
monitor.subTask(resources[i].getFullPath().toString());
if (!provider.isIgnored(resources[i])) {
multiStatus
.merge(((this.visit(
resources[i],
new SubProgressMonitor(monitor, 1000)))));
} else {
monitor.worked(1000);
}
}
// Finally, if any problems occurred, throw the exeption with all
// the statuses,
// but if there were no problems exit silently.
if (!multiStatus.isOK()) {
String message = multiStatus.matches(IStatus.ERROR) ? "There were errors that prevent the requested operation from finishing successfully."
: "The requested operation finished with warnings.";
TeamException te = new TeamException(new MultiStatus(
multiStatus.getPlugin(), multiStatus.getCode(),
multiStatus.getChildren(), message, multiStatus
.getException()));
throw new ExecutionException("This is an error title", te);
}
// Cause all the resource changes to be broadcast to listeners.
// TeamPlugin.getManager().broadcastResourceStateChanges(resources);
return multiStatus;
}
@Override
public IStatus redo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
MessageDialog.openInformation(PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getShell(),
"Checkout",
"Undoing view action");
return Status.OK_STATUS;
}
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
MessageDialog.openInformation(PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getShell(),
"Checkout",
"Undoing view action");
return Status.OK_STATUS;
}
public IStatus visit(IResource resource, IProgressMonitor monitor) {
try {
int returnCode = 1;// Used for message dialogs.
monitor
.beginTask("Checking out " + resource.getFullPath(),
100);
StateCache cache = provider.getCache(resource);
final StateCache targetElement = provider.getFinalTargetElement(cache);
// Sanity check - can't checkout something that is not part of
// clearcase
if (targetElement == null
|| !targetElement.isClearCaseElement())
return new Status(
IStatus.WARNING,
ID,
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
.format(
"Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
null);
// Sanity check - can't checkout something that is already
// checked out
if (targetElement.isCheckedOut())
// return status with severity OK
return new Status(IStatus.OK, ID,
TeamException.NOT_CHECKED_IN, MessageFormat.format(
"Resource \"{0}\" is already checked out!",
new Object[] { targetElement.getPath() }),
null);
IStatus result = Status.OK_STATUS;
// update if necessary
if (ClearCasePreferences.isCheckoutLatest()
&& targetElement.isSnapShot()) {
monitor.subTask("Updating " + targetElement.getPath());
provider.update(resource.getFullPath().toOSString(), 0, false);
}
monitor.worked(20);
// only checkout if update was successful
if (result == Status.OK_STATUS) {
monitor.subTask("Checking out " + targetElement.getPath());
try {
ClearCasePlugin
.getEngine()
.checkout(
new String[] { targetElement.getPath() },
provider.getComment(),
provider.getCheckoutType()
| ClearCase.PTIME
| (targetElement.isHijacked() ? ClearCase.HIJACKED
: ClearCase.NONE),
null);
} catch (ClearCaseException cce) {
switch (cce.getErrorCode()) {
case ClearCase.ERROR_ELEMENT_HAS_CHECKOUTS:
returnCode = provider.showMessageDialog("Checkout",
"Resource already checked-out reserved.\nDo you want to check-out unreserved?");
if (returnCode == 0) {
// Yes continue checking out but
// unreserved.
ClearCasePlugin.getEngine()
.checkout(
new String[] { targetElement
.getPath() },
provider.getComment(),
ClearCase.UNRESERVED
| ClearCase.PTIME,
null);
monitor.worked(40);
provider.updateState(resource, IResource.DEPTH_ZERO,
new SubProgressMonitor(monitor, 10));
}
break;
case ClearCase.ERROR_BRANCH_IS_MASTERED_BY_REPLICA:
returnCode = provider.showMessageDialog(
"Checkout",
"Resource could not be checked out since not your replica.\nDo you want change mastership?");
provider.changeMastershipSequence(returnCode, targetElement,
null);
monitor.worked(40);
provider.updateState(resource, IResource.DEPTH_ZERO,
new SubProgressMonitor(monitor, 10));
break;
default:
result = new Status(
IStatus.ERROR,
ID,
TeamException.UNABLE,
MessageFormat
.format(
Messages
.getString("ClearCasePlugin.error.checkin.unknown"),
new Object[] { cce
.getElements() }),
null);
break;
}
}
}
monitor.worked(20);
// update state of target element first (if symlink)
if (!targetElement.equals(cache)) {
targetElement.doUpdate();
}
// update state
provider.updateState(resource, IResource.DEPTH_ZERO,
new SubProgressMonitor(monitor, 10));
return result;
} finally {
monitor.done();
}
}
}
|
|
From: Mikael P. <er...@us...> - 2012-01-18 13:10:25
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui.test In directory vz-cvs-4.sog:/tmp/cvs-serv26225 Modified Files: .classpath Log Message: Add mock lib Index: .classpath =================================================================== RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui.test/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 1 Dec 2011 09:16:05 -0000 1.2 --- .classpath 18 Jan 2012 13:10:23 -0000 1.3 *************** *** 1,6 **** --- 1,13 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/cglib-nodep-2.2.jar"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/easymock-3.0.jar"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/javassist-3.15.0-GA.jar"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/junit-4.8.2.jar"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/objenesis-1.2.jar"/> + <classpathentry kind="lib" path="/net.sourceforge.eclipseccase/lib/powermock-easymock-junit-1.4.10/powermock-easymock-1.4.10-full.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
|
From: Mikael P. <er...@us...> - 2012-01-18 13:08:12
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/META-INF In directory vz-cvs-4.sog:/tmp/cvs-serv25972/META-INF Modified Files: MANIFEST.MF Log Message: changed version Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/META-INF/MANIFEST.MF,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** MANIFEST.MF 28 Nov 2011 08:50:34 -0000 1.33 --- MANIFEST.MF 18 Jan 2012 13:08:10 -0000 1.34 *************** *** 3,7 **** Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.eclipseccase.ui; singleton:=true ! Bundle-Version: 2.2.12.qualifier Bundle-Activator: net.sourceforge.eclipseccase.ui.ClearCaseUI Bundle-Vendor: %providerName --- 3,7 ---- Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.eclipseccase.ui; singleton:=true ! Bundle-Version: 2.2.13.qualifier Bundle-Activator: net.sourceforge.eclipseccase.ui.ClearCaseUI Bundle-Vendor: %providerName |
|
From: Mikael P. <er...@us...> - 2012-01-18 13:05:31
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.test/src/net/sourceforge/eclipseccase/test
In directory vz-cvs-4.sog:/tmp/cvs-serv25712/src/net/sourceforge/eclipseccase/test
Added Files:
MoveHandlerTest.java
Log Message:
Added another test
--- NEW FILE: MoveHandlerTest.java ---
/**
*
*/
package net.sourceforge.eclipseccase.test;
import static org.junit.Assert.*;
import net.sourceforge.clearcase.ClearCaseInterface;
import net.sourceforge.eclipseccase.ClearCasePlugin;
import net.sourceforge.eclipseccase.ClearCaseProvider;
import net.sourceforge.eclipseccase.MoveHandler;
import org.easymock.EasyMock;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.team.IResourceTree;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
/**
* @author mikael petterson
*
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest( { IResourceTree.class, IFile.class, IProgressMonitor.class })
public class MoveHandlerTest {
// mock instance
private IResourceTree resourceTreeMock;
private IFile sourceMock;
private IFile destinationMock;
private IProgressMonitor monitorMock;
private ClearCaseProvider providerMock;
private IStatus statusMock;
//class under test
private MoveHandler moveHandler;
@Before
public void setUp() {
resourceTreeMock = PowerMock.createMock(IResourceTree.class);
sourceMock = PowerMock.createMock(IFile.class,"source");
destinationMock = PowerMock.createMock(IFile.class,"destination");
monitorMock = PowerMock.createMock(IProgressMonitor.class);
providerMock = PowerMock.createMock(ClearCaseProvider.class);
statusMock = PowerMock.createMock(IStatus.class);
moveHandler = new MoveHandler(providerMock);
}
/**
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#deleteFile(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFile, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testDeleteFile() {
fail("Not yet implemented");
}
/**
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#deleteFolder(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFolder, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testDeleteFolder() {
fail("Not yet implemented");
}
/**
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#deleteProject(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IProject, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testDeleteProject() {
fail("Not yet implemented");
}
/**
* Testing how we can handle an excpetion form the clearcase-java layer.
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#moveFile(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFile, org.eclipse.core.resources.IFile, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testMoveFile() {
int updateFlags = 1;
//No standard move
EasyMock.expect(providerMock.isIgnored(sourceMock)).andReturn(false);
EasyMock.expect(sourceMock.isLinked()).andReturn(false);
EasyMock.expect(providerMock.isClearCaseElement(sourceMock)).andReturn(true);
EasyMock.expect(sourceMock.getName()).andReturn("myFile");
//IStatus status = validateDest(destination,
// new SubProgressMonitor(monitor, 40));
EasyMock.expect(resourceTreeMock.isSynchronized(sourceMock,IResource.DEPTH_INFINITE)).andReturn(true);
EasyMock.expect(statusMock.getCode()).andReturn(IStatus.OK);
fail("Not yet implemented");
}
/**
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#moveFolder(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFolder, org.eclipse.core.resources.IFolder, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testMoveFolder() {
fail("Not yet implemented");
}
/**
* Test method for {@link net.sourceforge.eclipseccase.MoveHandler#moveProject(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IProject, org.eclipse.core.resources.IProjectDescription, int, org.eclipse.core.runtime.IProgressMonitor)}.
*/
@Test
public void testMoveProject() {
fail("Not yet implemented");
}
}
|
|
From: Mikael P. <er...@us...> - 2012-01-18 13:04:47
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.feature
In directory vz-cvs-4.sog:/tmp/cvs-serv24573
Modified Files:
feature.xml
Log Message:
changed version
Index: feature.xml
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.feature/feature.xml,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** feature.xml 28 Nov 2011 08:50:23 -0000 1.57
--- feature.xml 18 Jan 2012 13:04:45 -0000 1.58
***************
*** 3,7 ****
id="net.sourceforge.eclipseccase"
label="%featureName"
! version="2.2.12.qualifier"
provider-name="%providerName"
image="eclipse-ccase.jpg">
--- 3,7 ----
id="net.sourceforge.eclipseccase"
label="%featureName"
! version="2.2.13.qualifier"
provider-name="%providerName"
image="eclipse-ccase.jpg">
***************
*** 35,39 ****
download-size="1000"
install-size="1800"
! version="2.2.12.qualifier"/>
<plugin
--- 35,39 ----
download-size="1000"
install-size="1800"
! version="2.2.13.qualifier"/>
<plugin
***************
*** 41,45 ****
download-size="400"
install-size="800"
! version="2.2.12.qualifier"
unpack="false"/>
--- 41,45 ----
download-size="400"
install-size="800"
! version="2.2.13.qualifier"
unpack="false"/>
***************
*** 48,52 ****
download-size="400"
install-size="800"
! version="2.2.12.qualifier"
unpack="false"/>
--- 48,52 ----
download-size="400"
install-size="800"
! version="2.2.13.qualifier"
unpack="false"/>
|
|
From: Mikael P. <er...@us...> - 2012-01-18 13:04:16
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/META-INF In directory vz-cvs-4.sog:/tmp/cvs-serv24499/META-INF Modified Files: MANIFEST.MF CHANGELOG.txt Log Message: changed version Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/META-INF/MANIFEST.MF,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** MANIFEST.MF 28 Nov 2011 08:50:27 -0000 1.37 --- MANIFEST.MF 18 Jan 2012 13:04:14 -0000 1.38 *************** *** 3,7 **** Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.eclipseccase; singleton:=true ! Bundle-Version: 2.2.12.qualifier Bundle-Activator: net.sourceforge.eclipseccase.ClearCasePlugin Bundle-Vendor: %providerName --- 3,7 ---- Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.eclipseccase; singleton:=true ! Bundle-Version: 2.2.13.qualifier Bundle-Activator: net.sourceforge.eclipseccase.ClearCasePlugin Bundle-Vendor: %providerName Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/META-INF/CHANGELOG.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CHANGELOG.txt 16 Dec 2011 15:01:48 -0000 1.27 --- CHANGELOG.txt 18 Jan 2012 13:04:14 -0000 1.28 *************** *** 7,10 **** --- 7,11 ---- Bugs: 3451495 Renaming Class caused ArrayIndexOutOfBoundsException - 0 + 3473425 error checkout directory that is soft link Feature: |
|
From: Mikael P. <er...@us...> - 2012-01-18 13:03:51
|
Update of /cvsroot/clearcase-java/net.sourceforge.clearcase/META-INF In directory vz-cvs-4.sog:/tmp/cvs-serv24408/META-INF Modified Files: MANIFEST.MF Log Message: changed version Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/clearcase-java/net.sourceforge.clearcase/META-INF/MANIFEST.MF,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** MANIFEST.MF 28 Nov 2011 08:50:31 -0000 1.34 --- MANIFEST.MF 18 Jan 2012 13:03:48 -0000 1.35 *************** *** 3,7 **** Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.clearcase ! Bundle-Version: 2.2.12.qualifier Bundle-ClassPath: clearcase.jar Bundle-Vendor: %providerName --- 3,7 ---- Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.clearcase ! Bundle-Version: 2.2.13.qualifier Bundle-ClassPath: clearcase.jar Bundle-Vendor: %providerName |
|
From: Mikael P. <er...@us...> - 2012-01-13 13:45:27
|
Update of /cvsroot/clearcase-java/net.sourceforge.clearcase/src/commandline/net/sourceforge/clearcase/commandline/output/strategy
In directory vz-cvs-4.sog:/tmp/cvs-serv15740/src/commandline/net/sourceforge/clearcase/commandline/output/strategy
Modified Files:
DirectoryIsNotCheckedOut.java
Added Files:
UnableToModifyDirectory.java
Log Message:
3473425 error checkout directory that is soft link
Index: DirectoryIsNotCheckedOut.java
===================================================================
RCS file: /cvsroot/clearcase-java/net.sourceforge.clearcase/src/commandline/net/sourceforge/clearcase/commandline/output/strategy/DirectoryIsNotCheckedOut.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DirectoryIsNotCheckedOut.java 19 Feb 2010 09:07:55 -0000 1.5
--- DirectoryIsNotCheckedOut.java 13 Jan 2012 13:45:25 -0000 1.6
***************
*** 33,37 ****
@Override
protected String getPattern() {
! return "cleartool: Error: Can't modify directory .* because it is not checked out.";
}
--- 33,37 ----
@Override
protected String getPattern() {
! return "cleartool: Error: Can't modify directory \"(.*)\" because it is not checked out.";
}
--- NEW FILE: UnableToModifyDirectory.java ---
/*******************************************************************************
* Copyright (c) 2002, 2012 eclipse-ccase.sourceforge.net team and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Gunnar Wagenknecht - initial API and implementation
* Eclipse.org - concepts and ideas from Eclipse
*******************************************************************************/
package net.sourceforge.clearcase.commandline.output.strategy;
import java.util.regex.Matcher;
import net.sourceforge.clearcase.ClearCase;
import net.sourceforge.clearcase.ClearCaseElementState;
import net.sourceforge.clearcase.ClearCaseException;
/**
* TODO Provide description for UnableToModifyDirectory reports that is was
* not possible to modify a directory beacause it is not checkedout.
*/
public class UnableToModifyDirectory extends AbstractMatcherStrategy {
/* (non-Javadoc)
* @see net.sourceforge.clearcase.commandline.output.strategy.AbstractMatcherStrategy#getPattern()
*/
@Override
protected String getPattern() {
return "cleartool: Error: Can't modify directory \"(.*)\" because it is not checked out\\.";
}
/* (non-Javadoc)
* @see net.sourceforge.clearcase.commandline.output.strategy.AbstractMatcherStrategy#getResult(java.lang.String, java.util.regex.Matcher)
*/
@Override
protected ClearCaseElementState getResult(String output, Matcher matcher)
throws ClearCaseException {
// TODO Auto-generated method stub
String element = matcher.group(1);
throw new ClearCaseException(ClearCase.ERROR_DIR_IS_NOT_CHECKED_OUT,"Directory "+element+"could not be modified since it is not checked out.");
}
}
|
|
From: Mikael P. <er...@us...> - 2012-01-13 13:44:46
|
Update of /cvsroot/clearcase-java/net.sourceforge.clearcase/src/common/net/sourceforge/clearcase In directory vz-cvs-4.sog:/tmp/cvs-serv15647/src/common/net/sourceforge/clearcase Modified Files: ClearCase.java ClearCaseInterface.java Log Message: 3473425 error checkout directory that is soft link Index: ClearCase.java =================================================================== RCS file: /cvsroot/clearcase-java/net.sourceforge.clearcase/src/common/net/sourceforge/clearcase/ClearCase.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ClearCase.java 20 Nov 2011 15:07:14 -0000 1.37 --- ClearCase.java 13 Jan 2012 13:44:44 -0000 1.38 *************** *** 675,678 **** --- 675,679 ---- case ERROR_NOT_AN_ELEMENT: case ERROR_NOT_CHECKED_OUT: + case ERROR_DIR_IS_NOT_CHECKED_OUT: case ERROR_IO: case ERROR_INTERFACE_DISPOSED: Index: ClearCaseInterface.java =================================================================== RCS file: /cvsroot/clearcase-java/net.sourceforge.clearcase/src/common/net/sourceforge/clearcase/ClearCaseInterface.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ClearCaseInterface.java 2 Dec 2011 07:19:27 -0000 1.50 --- ClearCaseInterface.java 13 Jan 2012 13:44:44 -0000 1.51 *************** *** 865,870 **** * @see ClearCase#RECURSIVE */ ! public abstract ClearCaseElementState[] findCheckouts(String[] elements, ! int flags, OperationListener operationListener); // public abstract ClearCaseElementState ccElement(String element, int --- 865,870 ---- * @see ClearCase#RECURSIVE */ ! public abstract String [] findCheckouts(int flags,HashMap<Integer, String> args, ! String [] elements); // public abstract ClearCaseElementState ccElement(String element, int |
|
From: Mikael P. <er...@us...> - 2012-01-13 13:43:25
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase
In directory vz-cvs-4.sog:/tmp/cvs-serv15423/src/net/sourceforge/eclipseccase
Modified Files:
ClearCaseProvider.java MoveHandler.java
Log Message:
3473425 error checkout directory that is soft link
Index: ClearCaseProvider.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/ClearCaseProvider.java,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** ClearCaseProvider.java 21 Dec 2011 12:02:51 -0000 1.76
--- ClearCaseProvider.java 13 Jan 2012 13:43:23 -0000 1.77
***************
*** 16,19 ****
--- 16,22 ----
import java.text.MessageFormat;
import java.util.*;
+ import java.util.regex.Matcher;
+ import java.util.regex.Pattern;
+
import net.sourceforge.clearcase.ClearCase;
import net.sourceforge.clearcase.ClearCaseCLIImpl;
***************
*** 85,92 ****
public static final String NO_ACTIVITY = "No activity in view";
boolean refreshResources = true;
private OperationListener opListener = null;
!
private boolean isTest = false;
--- 88,103 ----
public static final String NO_ACTIVITY = "No activity in view";
+ public static final String UNRESERVED = "unreserved";
+
+ public static final String RESERVED = "reserved";
+
+ // is used to keep track of which views that has a file checked out when
+ // doing a move.
+ public static final ArrayList<String> checkedOutInOtherView = new ArrayList<String>();
+
boolean refreshResources = true;
private OperationListener opListener = null;
!
private boolean isTest = false;
***************
*** 402,405 ****
--- 413,456 ----
}
+ /**
+ * Parsers single/multiple line/-s of output. Type.java Predecessor:
+ * /main/dev/0 View:eraonel_w12b2 Status: unreserved
+ *
+ * @param element
+ * @return
+ */
+ public boolean isCheckedOutInAnyView(String element) {
+ boolean isCheckedoutInOtherView = false;
+ checkedOutInOtherView.clear();
+ HashMap<Integer, String> args = new HashMap<Integer, String>();
+ args
+ .put(Integer.valueOf(ClearCase.FORMAT),
+ "%En\tPredecessor: %[version_predecessor]p\tView: %Tf\tStatus: %Rf\n");
+ String[] output = ClearCasePlugin.getEngine().findCheckouts(
+ ClearCase.FORMAT, args, new String[] { element });
+ // Check if line ends with these keywords.
+ Pattern pattern = Pattern.compile(".*View:\\s(.*)\\sStatus:.*");
+
+ if (output.length > 0) {
+ // we have file checked-out in other view.
+ isCheckedoutInOtherView = true;
+ for (int i = 0; i < output.length; i++) {
+ String line = output[i];
+ Matcher matcher = pattern.matcher(line);
+ if (matcher.find()) {
+ // Adding information to user.Filter out current view.
+ String view = matcher.group(1);
+ if (!view.equals(getViewName(element))) {
+ checkedOutInOtherView.add(view);
+ }
+ }
+
+ }
+
+ }
+
+ return isCheckedoutInOtherView;
+ }
+
public static String getViewName(IResource resource) {
if (resource == null || resource.getProject() == null)
***************
*** 581,586 ****
}
! return new ArrayList<String>(
! Arrays.asList(new String[] { NO_ACTIVITY }));
}
--- 632,637 ----
}
! return new ArrayList<String>(Arrays
! .asList(new String[] { NO_ACTIVITY }));
}
***************
*** 637,644 ****
public ClearCaseElementState createActivity(String headline,
String activitySelector, String path) throws ClearCaseException {
! ClearCaseElementState[] cces = ClearCasePlugin.getEngine()
! .mkActivity(
! ClearCase.HEADLINE | ClearCase.FORCE | ClearCase.NSET,
! headline, activitySelector, path);
if (cces != null) {
return cces[0];
--- 688,694 ----
public ClearCaseElementState createActivity(String headline,
String activitySelector, String path) throws ClearCaseException {
! ClearCaseElementState[] cces = ClearCasePlugin.getEngine().mkActivity(
! ClearCase.HEADLINE | ClearCase.FORCE | ClearCase.NSET,
! headline, activitySelector, path);
if (cces != null) {
return cces[0];
***************
*** 657,664 ****
public String getCurrentStream() {
String result = "";
! String [] output = ClearCasePlugin.getEngine().getStream(ClearCase.SHORT, null);
if (output != null && output.length > 0) {
! result = output[0];
!
}
return result;
--- 707,715 ----
public String getCurrentStream() {
String result = "";
! String[] output = ClearCasePlugin.getEngine().getStream(
! ClearCase.SHORT, null);
if (output != null && output.length > 0) {
! result = output[0];
!
}
return result;
***************
*** 681,701 ****
* getStream() returns an array but contains one or no element.If we have
* actvities in stream we have one element.
! * activity:<activityId>@/vobs/$pvob,activity:<activityId>@/vobs/$pvob, activity: ...
! * All activities are on one line.
* @return array of activities or an empty array.
*/
public String[] getActivitySelectors(String view) {
! String[] result = new String[]{};
HashMap<Integer, String> args = new HashMap<Integer, String>();
args.put(Integer.valueOf(ClearCase.FORMAT), "%[activities]CXp");
args.put(Integer.valueOf(ClearCase.VIEW), view);
!
! String [] output = ClearCasePlugin.getEngine().getStream(
ClearCase.FORMAT | ClearCase.VIEW, args);
!
if (output != null && output.length == 1) {
result = output[0].split(", ");
}
!
return result;
--- 732,753 ----
* getStream() returns an array but contains one or no element.If we have
* actvities in stream we have one element.
! * activity:<activityId>@/vobs/$pvob,activity:<activityId>@/vobs/$pvob,
! * activity: ... All activities are on one line.
! *
* @return array of activities or an empty array.
*/
public String[] getActivitySelectors(String view) {
! String[] result = new String[] {};
HashMap<Integer, String> args = new HashMap<Integer, String>();
args.put(Integer.valueOf(ClearCase.FORMAT), "%[activities]CXp");
args.put(Integer.valueOf(ClearCase.VIEW), view);
!
! String[] output = ClearCasePlugin.getEngine().getStream(
ClearCase.FORMAT | ClearCase.VIEW, args);
!
if (output != null && output.length == 1) {
result = output[0].split(", ");
}
!
return result;
***************
*** 719,722 ****
--- 771,775 ----
public IStatus move(IResource source, IResource destination,
IProgressMonitor monitor) {
+ int returnCode = 1;// Used in messge dialog.
try {
monitor.beginTask("Moving " + source.getFullPath() + " to "
***************
*** 729,733 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not under source control!",
new Object[] { source.getFullPath()
.toString() }), null);
--- 782,787 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not under source control!",
new Object[] { source.getFullPath()
.toString() }), null);
***************
*** 736,742 ****
ClearCaseElementState[] state = null;
if (ClearCasePreferences.isAutoCheckinParentAfterMoveAllowed()) {
state = ClearCasePlugin.getEngine()
! .move(source.getLocation().toOSString(),
destination.getLocation().toOSString(),
getComment(),
--- 790,825 ----
ClearCaseElementState[] state = null;
+ if (isCheckedOutInAnyView(source.getLocation().toOSString())) {
+
+ StringBuffer sb = new StringBuffer();
+ for (String view : checkedOutInOtherView) {
+ sb.append(view + "\t");
+ }
+ // Open message dialog and ask if we want to continue.
+ returnCode = showMessageDialog(
+ "File Checkedout in Other View ",
+ "File checkedout in the following views: "
+ + sb.toString()+"\n"
+ + " Do you still want to move, "
+ + source.getName() + "?");
+
+ }
+ // If not 1 ( ok) then we cancel operation.
+ if (returnCode != 0) {
+ return new Status(
+ IStatus.ERROR,
+ ID,
+ TeamException.CONFLICT,
+ MessageFormat
+ .format(
+ "Cancelled move operation for \"{0}\"!",
+ new Object[] { source.getFullPath()
+ .toString() }), null);
+ }
+
if (ClearCasePreferences.isAutoCheckinParentAfterMoveAllowed()) {
state = ClearCasePlugin.getEngine()
! .move(
! source.getLocation().toOSString(),
destination.getLocation().toOSString(),
getComment(),
***************
*** 925,947 ****
File target = new File(cache.getSymbolicLinkTarget());
if (!target.isAbsolute()) {
! target = null != cache.getPath() ? new File(
! cache.getPath()).getParentFile() : null;
if (null != target) {
! target = new File(target,
! cache.getSymbolicLinkTarget());
}
}
if (null != target && target.exists()) {
! IPath targetLocation = new Path(
! target.getAbsolutePath());
IResource[] resources = null;
if (target.isDirectory()) {
resources = ResourcesPlugin.getWorkspace()
! .getRoot()
! .findContainersForLocation(targetLocation);
} else {
resources = ResourcesPlugin.getWorkspace()
! .getRoot()
! .findFilesForLocation(targetLocation);
}
if (null != resources) {
--- 1008,1030 ----
File target = new File(cache.getSymbolicLinkTarget());
if (!target.isAbsolute()) {
! target = null != cache.getPath() ? new File(cache
! .getPath()).getParentFile() : null;
if (null != target) {
! target = new File(target, cache
! .getSymbolicLinkTarget());
}
}
if (null != target && target.exists()) {
! IPath targetLocation = new Path(target
! .getAbsolutePath());
IResource[] resources = null;
if (target.isDirectory()) {
resources = ResourcesPlugin.getWorkspace()
! .getRoot().findContainersForLocation(
! targetLocation);
} else {
resources = ResourcesPlugin.getWorkspace()
! .getRoot().findFilesForLocation(
! targetLocation);
}
if (null != resources) {
***************
*** 951,957 ****
.getClearCaseProvider(foundResource);
if (null != provider) {
! StateCacheFactory.getInstance()
! .get(foundResource)
! .updateAsync(false);
// after the target is updated, we must
// update the
--- 1034,1039 ----
.getClearCaseProvider(foundResource);
if (null != provider) {
! StateCacheFactory.getInstance().get(
! foundResource).updateAsync(false);
// after the target is updated, we must
// update the
***************
*** 988,992 ****
TeamException.UNABLE,
MessageFormat
! .format("Resource \"{0}\" is already under source control!",
new Object[] { resource
.getFullPath().toString() }),
--- 1070,1075 ----
TeamException.UNABLE,
MessageFormat
! .format(
! "Resource \"{0}\" is already under source control!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1125,1129 ****
ClearCaseElementState state = ClearCasePlugin
.getEngine()
! .add(resource.getLocation().toOSString(),
false,
getComment(),
--- 1208,1213 ----
ClearCaseElementState state = ClearCasePlugin
.getEngine()
! .add(
! resource.getLocation().toOSString(),
false,
getComment(),
***************
*** 1254,1258 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1338,1343 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1309,1313 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1394,1399 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1317,1322 ****
if (result.isOK()) {
ClearCasePlugin.getEngine()
! .delete(new String[] { resource.getLocation()
! .toOSString() }, getComment(),
ClearCase.RECURSIVE | ClearCase.KEEP,
opListener);
--- 1403,1409 ----
if (result.isOK()) {
ClearCasePlugin.getEngine()
! .delete(
! new String[] { resource.getLocation()
! .toOSString() }, getComment(),
ClearCase.RECURSIVE | ClearCase.KEEP,
opListener);
***************
*** 1356,1360 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1443,1448 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1390,1396 ****
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat.format(
! Messages.getString("ClearCasePlugin.error.checkin.identicalPredecessor"),
! new Object[] { cce.getElements() }),
null);
break;
--- 1478,1487 ----
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat
! .format(
! Messages
! .getString("ClearCasePlugin.error.checkin.identicalPredecessor"),
! new Object[] { cce
! .getElements() }),
null);
break;
***************
*** 1400,1406 ****
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat.format(
! Messages.getString("ClearCasePlugin.error.checkin.elementHasCheckouts"),
! new Object[] { cce.getElements() }),
null);
break;
--- 1491,1500 ----
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat
! .format(
! Messages
! .getString("ClearCasePlugin.error.checkin.elementHasCheckouts"),
! new Object[] { cce
! .getElements() }),
null);
break;
***************
*** 1412,1418 ****
String latestVersion = resource.getLocation()
.toOSString()
! + "@@"
! + branchName
! + "LATEST";
ClearCaseElementState myState = ClearCasePlugin
--- 1506,1510 ----
String latestVersion = resource.getLocation()
.toOSString()
! + "@@" + branchName + "LATEST";
ClearCaseElementState myState = ClearCasePlugin
***************
*** 1428,1438 ****
if (returnCode == 0) {
// Yes continue checkin
! ClearCasePlugin
! .getEngine()
! .checkin(
! new String[] { targetElement
! .getPath() },
! getComment(),
! ClearCase.PTIME, opListener);
}
--- 1520,1527 ----
if (returnCode == 0) {
// Yes continue checkin
! ClearCasePlugin.getEngine().checkin(
! new String[] { targetElement
! .getPath() }, getComment(),
! ClearCase.PTIME, opListener);
}
***************
*** 1443,1450 ****
ID,
TeamException.CONFLICT,
! MessageFormat.format(
! Messages.getString("ClearCasePlugin.error.checkin.mergeLatestProblem"),
! new Object[] { cce
! .getElements() }), null);
}
--- 1532,1542 ----
ID,
TeamException.CONFLICT,
! MessageFormat
! .format(
! Messages
! .getString("ClearCasePlugin.error.checkin.mergeLatestProblem"),
! new Object[] { cce
! .getElements() }),
! null);
}
***************
*** 1456,1462 ****
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat.format(
! Messages.getString("ClearCasePlugin.error.checkin.unknown"),
! new Object[] { cce.getElements() }),
null);
--- 1548,1557 ----
ID,
TeamException.NOT_CHECKED_IN,
! MessageFormat
! .format(
! Messages
! .getString("ClearCasePlugin.error.checkin.unknown"),
! new Object[] { cce
! .getElements() }),
null);
***************
*** 1484,1488 ****
try {
int returnCode = 1;// Used for message dialogs.
! monitor.beginTask("Checking out " + resource.getFullPath(), 100);
StateCache cache = getCache(resource);
final StateCache targetElement = getFinalTargetElement(cache);
--- 1579,1585 ----
try {
int returnCode = 1;// Used for message dialogs.
! monitor
! .beginTask("Checking out " + resource.getFullPath(),
! 100);
StateCache cache = getCache(resource);
final StateCache targetElement = getFinalTargetElement(cache);
***************
*** 1496,1500 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1593,1598 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1546,1551 ****
// Yes continue checking out but
// unreserved.
! ClearCasePlugin
! .getEngine()
.checkout(
new String[] { targetElement
--- 1644,1648 ----
// Yes continue checking out but
// unreserved.
! ClearCasePlugin.getEngine()
.checkout(
new String[] { targetElement
***************
*** 1577,1583 ****
ID,
TeamException.UNABLE,
! MessageFormat.format(
! Messages.getString("ClearCasePlugin.error.checkin.unknown"),
! new Object[] { cce.getElements() }),
null);
--- 1674,1683 ----
ID,
TeamException.UNABLE,
! MessageFormat
! .format(
! Messages
! .getString("ClearCasePlugin.error.checkin.unknown"),
! new Object[] { cce
! .getElements() }),
null);
***************
*** 1618,1622 ****
TeamException.NOT_AUTHORIZED,
MessageFormat
! .format("Resource \"{0}\" is not a Hijacked ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1718,1723 ----
TeamException.NOT_AUTHORIZED,
MessageFormat
! .format(
! "Resource \"{0}\" is not a Hijacked ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1637,1641 ****
if (keep.exists()) {
keep.renameTo(new File(resource.getLocation()
! .toOSString() + ".keep"));
}
} catch (Exception e) {
--- 1738,1743 ----
if (keep.exists()) {
keep.renameTo(new File(resource.getLocation()
! .toOSString()
! + ".keep"));
}
} catch (Exception e) {
***************
*** 1682,1686 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1784,1789 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1705,1711 ****
IProgressMonitor monitor) {
try {
! monitor.beginTask(
! "Changing checkout to unreserved "
! + resource.getFullPath(), 100);
// Sanity check - can't update something that is not part of
--- 1808,1813 ----
IProgressMonitor monitor) {
try {
! monitor.beginTask("Changing checkout to unreserved "
! + resource.getFullPath(), 100);
// Sanity check - can't update something that is not part of
***************
*** 1717,1721 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1819,1824 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1741,1747 ****
IProgressMonitor monitor) {
try {
! monitor.beginTask(
! "Changing checkout to reserved "
! + resource.getFullPath(), 100);
// Sanity check - can't update something that is not part of
--- 1844,1849 ----
IProgressMonitor monitor) {
try {
! monitor.beginTask("Changing checkout to reserved "
! + resource.getFullPath(), 100);
// Sanity check - can't update something that is not part of
***************
*** 1753,1757 ****
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format("Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
--- 1855,1860 ----
TeamException.NO_REMOTE_RESOURCE,
MessageFormat
! .format(
! "Resource \"{0}\" is not a ClearCase element!",
new Object[] { resource
.getFullPath().toString() }),
***************
*** 1835,1840 ****
throw new TeamException(new MultiStatus(
multiStatus.getPlugin(), multiStatus.getCode(),
! multiStatus.getChildren(), message,
! multiStatus.getException()));
}
// Cause all the resource changes to be broadcast to listeners.
--- 1938,1943 ----
throw new TeamException(new MultiStatus(
multiStatus.getPlugin(), multiStatus.getCode(),
! multiStatus.getChildren(), message, multiStatus
! .getException()));
}
// Cause all the resource changes to be broadcast to listeners.
***************
*** 1880,1885 ****
// multi-status.
MultiStatus multiStatus = new MultiStatus(status.getPlugin(),
! status.getCode(), status.getMessage(),
! status.getException());
// The next level will be one less than the current level...
int childDepth = (depth == IResource.DEPTH_ONE) ? IResource.DEPTH_ZERO
--- 1983,1988 ----
// multi-status.
MultiStatus multiStatus = new MultiStatus(status.getPlugin(),
! status.getCode(), status.getMessage(), status
! .getException());
// The next level will be one less than the current level...
int childDepth = (depth == IResource.DEPTH_ONE) ? IResource.DEPTH_ZERO
Index: MoveHandler.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/MoveHandler.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** MoveHandler.java 22 Dec 2010 14:53:39 -0000 1.25
--- MoveHandler.java 13 Jan 2012 13:43:23 -0000 1.26
***************
*** 1,6 ****
--- 1,9 ----
package net.sourceforge.eclipseccase;
+ import java.text.MessageFormat;
import java.util.LinkedList;
+ import net.sourceforge.clearcase.ClearCaseError;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
***************
*** 18,21 ****
--- 21,26 ----
public class MoveHandler implements IMoveDeleteHook {
+
+ public static final String ID = "net.sourceforge.eclipseccase.MoveHandler"; //$NON-NLS-1$
ClearCaseProvider provider;
***************
*** 266,275 ****
}
! return true;
!
} finally {
provider.refreshResources = true;
monitor.done();
}
}
}
--- 271,288 ----
}
! //return true;
! }catch(ClearCaseError e){
! tree.failed(new Status(
! IStatus.ERROR,
! ID,
! TeamException.UNABLE
! ,"An Error occurred! "+e.getMessage(), e));
!
} finally {
provider.refreshResources = true;
monitor.done();
}
+
+ return true;
}
}
|
|
From: Mikael P. <er...@us...> - 2012-01-13 13:41:58
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui
In directory vz-cvs-4.sog:/tmp/cvs-serv14207/src/net/sourceforge/eclipseccase/ui
Modified Files:
ClearCaseUIModificationHandler.java
Log Message:
3473425 error checkout directory that is soft link
Index: ClearCaseUIModificationHandler.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/ClearCaseUIModificationHandler.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ClearCaseUIModificationHandler.java 16 Dec 2011 15:01:44 -0000 1.19
--- ClearCaseUIModificationHandler.java 13 Jan 2012 13:41:55 -0000 1.20
***************
*** 65,69 ****
*/
private IStatus checkout(final IFile[] files, final Shell shell) {
! System.out.println(getClass().getName()+"checkout()");
final ClearCaseProvider provider = getProvider(files);
if (PreventCheckoutHelper.isPreventedFromCheckOut(provider, files, true))
--- 65,69 ----
*/
private IStatus checkout(final IFile[] files, final Shell shell) {
!
final ClearCaseProvider provider = getProvider(files);
if (PreventCheckoutHelper.isPreventedFromCheckOut(provider, files, true))
***************
*** 173,177 ****
return (Shell) context;
if (context instanceof FileModificationValidationContext)
! return (Shell) (((FileModificationValidationContext) context).getShell());
return null;
}
--- 173,178 ----
return (Shell) context;
if (context instanceof FileModificationValidationContext)
! return (Shell) (((FileModificationValidationContext)context).getShell());
!
return null;
}
***************
*** 192,199 ****
return CANCEL;
// We are allowed to checkout file.
final Shell shell = getShell(context);
final boolean askForComment = ClearCasePreferences.isCommentCheckout() && !ClearCasePreferences.isCommentCheckoutNeverOnAuto();
if (null == shell || !askForComment) {
! System.out.println("Shell is set to "+shell+" and askForComment is "+askForComment);
return super.validateEdit(files, context);
}
--- 193,202 ----
return CANCEL;
// We are allowed to checkout file.
+
final Shell shell = getShell(context);
final boolean askForComment = ClearCasePreferences.isCommentCheckout() && !ClearCasePreferences.isCommentCheckoutNeverOnAuto();
if (null == shell || !askForComment) {
!
!
return super.validateEdit(files, context);
}
|
|
From: Mikael P. <er...@us...> - 2012-01-12 12:44:46
|
Update of /cvsroot/clearcase-java/net.sourceforge.clearcase.test/src/net/sourceforge/clearcase/tests/output
In directory vz-cvs-4.sog:/tmp/cvs-serv25844/src/net/sourceforge/clearcase/tests/output
Modified Files:
MoveOutputScenarioTest.java
Log Message:
Adding test case for unsuccessful modify when directory is not checked out.
Index: MoveOutputScenarioTest.java
===================================================================
RCS file: /cvsroot/clearcase-java/net.sourceforge.clearcase.test/src/net/sourceforge/clearcase/tests/output/MoveOutputScenarioTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MoveOutputScenarioTest.java 14 Dec 2011 12:25:16 -0000 1.2
--- MoveOutputScenarioTest.java 12 Jan 2012 12:44:44 -0000 1.3
***************
*** 61,64 ****
--- 61,65 ----
}
}
+
/**
* Make sure we can have numbers in path.
***************
*** 79,83 ****
}
}
!
public void testMoveWithMixOfCharactersInPath() {
try {
--- 80,84 ----
}
}
!
public void testMoveWithMixOfCharactersInPath() {
try {
***************
*** 96,98 ****
--- 97,113 ----
}
+ /**
+ *
+ */
+ public void testMovedFailedDueDirNotCheckedout() {
+ String[] cleartoolOutput = new String[] { "cleartool: Error: Can't modify directory \"/vobs/test/app/rsa_ws/workspace/pge\" because it is not checked out." };
+ try {
+ getClearCaseCLI().parserCCOutput(cleartoolOutput);
+ fail();
+ } catch (ClearCaseException e) {
+ assertTrue(e.getErrorCode() == ClearCase.ERROR_DIR_IS_NOT_CHECKED_OUT);
+ }
+
+ }
+
}
|
|
From: Mikael P. <er...@us...> - 2011-12-21 12:02:53
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase
In directory vz-cvs-4.sog:/tmp/cvs-serv7908/src/net/sourceforge/eclipseccase
Modified Files:
ClearCaseProvider.java
Log Message:
Added missing monitor.done() SubProgressMonitor
Index: ClearCaseProvider.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase/src/net/sourceforge/eclipseccase/ClearCaseProvider.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** ClearCaseProvider.java 2 Dec 2011 07:19:31 -0000 1.75
--- ClearCaseProvider.java 21 Dec 2011 12:02:51 -0000 1.76
***************
*** 734,743 ****
IStatus result = OK_STATUS;
-
- // boolean sourceParentCoBeforeOp =
- // isCheckedOut(source.getParent());
- // boolean targetParentCoBoforeOp = isCheckedOut(destination
- // .getParent());
-
ClearCaseElementState[] state = null;
--- 734,737 ----
***************
*** 773,776 ****
--- 767,771 ----
} finally {
setComment("");
+ monitor.done();
}
}
|