use of org.tigris.subversion.svnclientadapter.SVNConflictVersion in project subclipse by subclipse.
the class ResourceStatus method readFromVersion4Stream.
private void readFromVersion4Stream(StatusFromBytesStream dis) throws IOException {
fileExternal = dis.readBoolean();
treeConflicted = dis.readBoolean();
if (treeConflicted) {
int action = dis.readInt();
int reason = dis.readInt();
int operation = dis.readInt();
String leftReposURL = dis.readString();
long leftPegRevision = dis.readLong();
String leftPathInRepos = dis.readString();
int leftNodeKind = dis.readInt();
SVNConflictVersion srcLeftVersion = new SVNConflictVersion(leftReposURL, leftPegRevision, leftPathInRepos, leftNodeKind);
String rightReposURL = dis.readString();
long rightPegRevision = dis.readLong();
String rightPathInRepos = dis.readString();
int rightNodeKind = dis.readInt();
SVNConflictVersion srcRightVersion = new SVNConflictVersion(rightReposURL, rightPegRevision, rightPathInRepos, rightNodeKind);
conflictDescriptor = new SVNConflictDescriptor(url, action, reason, operation, srcLeftVersion, srcRightVersion);
} else
conflictDescriptor = null;
}
use of org.tigris.subversion.svnclientadapter.SVNConflictVersion in project subclipse by subclipse.
the class SVNPropertyPage method addSecondSection.
private void addSecondSection(Composite parent) {
Composite composite = createDefaultComposite(parent);
Label label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.status"));
statusValue = new Text(composite, SWT.READ_ONLY);
statusValue.setBackground(composite.getBackground());
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.propStatus"));
propertiesValue = new Text(composite, SWT.READ_ONLY);
propertiesValue.setBackground(composite.getBackground());
if (urlCopiedFrom != null || status.getMovedFromAbspath() != null) {
label = new Label(composite, SWT.NONE);
if (status.getMovedFromAbspath() != null) {
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.movedFrom"));
} else {
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.copiedFrom"));
}
copiedFromValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
copiedFromValue.setBackground(composite.getBackground());
GridData gd = new GridData();
gd.widthHint = 500;
copiedFromValue.setLayoutData(gd);
}
if (status.getLastChangedRevision() != null) {
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.changedRevision"));
lastChangedRevisionValue = new Text(composite, SWT.READ_ONLY);
lastChangedRevisionValue.setBackground(composite.getBackground());
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.changedDate"));
lastChangedDateValue = new Text(composite, SWT.READ_ONLY);
lastChangedDateValue.setBackground(composite.getBackground());
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.changedAuthor"));
lastCommitAuthorValue = new Text(composite, SWT.READ_ONLY);
lastCommitAuthorValue.setBackground(composite.getBackground());
}
if (lockOwnerText != null) {
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.lockOwner"));
lockOwner = new Text(composite, SWT.READ_ONLY);
lockOwner.setBackground(composite.getBackground());
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.lockCreationDate"));
lockCreationDate = new Text(composite, SWT.READ_ONLY);
lockCreationDate.setBackground(composite.getBackground());
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.lockComment"));
lockComment = new Label(composite, SWT.WRAP);
GridData gd = new GridData();
gd.widthHint = 500;
lockComment.setLayoutData(gd);
}
if (status.hasTreeConflict()) {
label = new Label(composite, SWT.NONE);
// $NON-NLS-1$
label.setText(Policy.bind("SVNPropertyPage.treeConflict"));
treeConflict = new Text(composite, SWT.READ_ONLY);
treeConflict.setBackground(composite.getBackground());
SVNConflictDescriptor conflictDescriptor = status.getConflictDescriptor();
if (// $NON-NLS-1$
conflictDescriptor == null)
// $NON-NLS-1$
treeConflict.setText("true");
else {
SVNTreeConflict svnTreeConflict = new SVNTreeConflict(status);
treeConflict.setText(svnTreeConflict.getDescription());
SVNConflictVersion srcLeftVersion = svnTreeConflict.getConflictDescriptor().getSrcLeftVersion();
if (srcLeftVersion != null) {
new Label(composite, SWT.NONE);
Text srcLeftVersionValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
GridData gd = new GridData();
gd.widthHint = 500;
srcLeftVersionValue.setLayoutData(gd);
// $NON-NLS-1$
srcLeftVersionValue.setText("Source left: " + srcLeftVersion.toString());
srcLeftVersionValue.setBackground(composite.getBackground());
}
SVNConflictVersion srcRightVersion = svnTreeConflict.getConflictDescriptor().getSrcRightVersion();
if (srcRightVersion != null) {
new Label(composite, SWT.NONE);
Text srcRightVersionValue = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
GridData gd = new GridData();
gd.widthHint = 500;
srcRightVersionValue.setLayoutData(gd);
srcRightVersionValue.setText(// $NON-NLS-1$
"Source right: " + srcRightVersion.toString());
srcRightVersionValue.setBackground(composite.getBackground());
}
}
}
}
use of org.tigris.subversion.svnclientadapter.SVNConflictVersion in project subclipse by subclipse.
the class MergeResultsView method createPartControl.
public void createPartControl(Composite parent) {
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 2;
layout.marginWidth = 0;
layout.marginHeight = 2;
parent.setLayout(layout);
treeViewer = new TreeViewer(parent);
treeViewer.setLabelProvider(labelProvider);
treeViewer.setContentProvider(new MergeResultsViewContentProvider());
treeViewer.setUseHashlookup(true);
GridData layoutData = new GridData();
layoutData.grabExcessHorizontalSpace = true;
layoutData.grabExcessVerticalSpace = true;
layoutData.horizontalAlignment = GridData.FILL;
layoutData.verticalAlignment = GridData.FILL;
treeViewer.getControl().setLayoutData(layoutData);
treeViewer.setInput(this);
treeViewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
treeConflict = null;
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
Object selectedItem = selection.getFirstElement();
MergeResult mergeResult = null;
if (selectedItem instanceof AdaptableMergeResult)
mergeResult = (MergeResult) selectedItem;
if (selectedItem instanceof AdaptableMergeResultsFolder) {
MergeResultsFolder mergeResultsFolder = (MergeResultsFolder) selectedItem;
mergeResult = mergeResultsFolder.getMergeResult();
}
if (mergeResult != null) {
if (mergeResult.getResource() instanceof IFile && mergeResult.isConflicted() && !mergeResult.isResolved()) {
editConflicts(mergeResult);
return;
}
if (mergeResult.getResource() instanceof IFile && mergeResult.hasTreeConflict() && !mergeResult.isTreeConflictResolved()) {
boolean addAddConflict = false;
if (mergeResult.getResource() != null && mergeResult.getResource().exists()) {
treeConflict = getTreeConflict(mergeResult.getResource());
if (treeConflict != null && treeConflict.getDescription() != null && treeConflict.getDescription().contains("local add") && treeConflict.getDescription().contains("incoming add")) {
// $NON-NLS-1$ //$NON-NLS-2$
addAddConflict = true;
}
if (!addAddConflict) {
openAction.run();
}
}
if (!addAddConflict) {
return;
}
}
if (!mergeResult.getAction().equals(MergeResult.ACTION_DELETE)) {
final ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(mergeResult.getResource());
if (!localResource.exists()) {
return;
}
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
public void run() {
try {
if (treeConflict != null) {
if (!localResource.isFolder()) {
SVNConflictDescriptor descriptor = treeConflict.getConflictDescriptor();
SVNConflictVersion rightVersion = descriptor.getSrcRightVersion();
try {
ISVNRemoteFile remoteFile = new RemoteFile(localResource.getRepository(), new SVNUrl(rightVersion.getReposURL() + "/" + rightVersion.getPathInRepos()), new SVNRevision.Number(rightVersion.getPegRevision()));
SVNLocalCompareInput compareInput = new SVNLocalCompareInput(localResource, remoteFile);
CompareUI.openCompareEditorOnPage(compareInput, getSite().getPage());
} catch (Exception e) {
}
}
return;
}
CompareUI.openCompareEditorOnPage(new SVNLocalCompareInput(localResource, SVNRevision.BASE), getSite().getPage());
} catch (SVNException e) {
if (!e.operationInterrupted()) {
Activator.handleError(Messages.MergeResultsView_compareError, e);
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MergeResultsView_compareWithLatest, e.getLocalizedMessage());
}
} catch (SVNClientException e) {
Activator.handleError(Messages.MergeResultsView_compareError, e);
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MergeResultsView_compareWithLatest, e.getLocalizedMessage());
}
}
});
}
}
}
});
treeViewer.getTree().addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
boolean mergeOutputSelected = false;
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
Iterator iter = selection.iterator();
while (iter.hasNext()) {
if (iter.next() instanceof MergeOutput) {
mergeOutputSelected = true;
break;
}
}
removeAction.setEnabled(mergeOutputSelected);
}
});
createMenus();
createToolbar();
getSite().setSelectionProvider(treeViewer);
if (Activator.getDefault().getPreferenceStore().getBoolean(CONFLICTS_ONLY_PREFERENCE))
setContentDescription(Messages.MergeResultsView_conflictsMode);
}
Aggregations