use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class CompareRemoteResourcesAction method isEnabled.
/*
* @see TeamAction#isEnabled()
*/
protected boolean isEnabled() {
ISVNRemoteResource[] resources = getSelectedRemoteResources();
boolean enabled = (resources.length == 2) && (resources[0].isContainer() == resources[1].isContainer());
if (!enabled) {
Object[] selectedObjects = selection.toArray();
if (selectedObjects.length == 2 && selectedObjects[0] instanceof ILogEntry && selectedObjects[1] instanceof ILogEntry) {
ILogEntry logEntry1 = (ILogEntry) selectedObjects[0];
ILogEntry logEntry2 = (ILogEntry) selectedObjects[1];
if (logEntry1.getResource() != null && logEntry1.getResource().isFolder() && logEntry2.getResource() != null && logEntry2.getResource().isFolder())
enabled = true;
}
}
return enabled;
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class Util method getUrlForRevision.
public static SVNUrl getUrlForRevision(ISVNRemoteResource resource, SVNRevision.Number revision, IProgressMonitor pm) throws SVNException {
SVNUrl url = resource.getUrl();
SVNRevision revisionStart = new SVNRevision.Number(revision.getNumber());
GetLogsCommand getLogsCommand = new GetLogsCommand(resource, SVNRevision.HEAD, revisionStart, SVNRevision.HEAD, false, 0, null, true);
getLogsCommand.run(pm);
ILogEntry[] logEntries = getLogsCommand.getLogEntries();
String path = resource.getRepositoryRelativePath().replaceAll("%20", " ");
for (int i = logEntries.length - 1; i > -1; i--) {
ILogEntry logEntry = logEntries[i];
if (!logEntry.getRevision().equals(revision)) {
LogEntryChangePath[] changePaths = logEntry.getLogEntryChangePaths();
for (LogEntryChangePath changePath : changePaths) {
if (changePath.getPath().equals(path) && changePath.getCopySrcPath() != null) {
try {
path = changePath.getCopySrcPath();
url = new SVNUrl(resource.getRepository().getRepositoryRoot().toString() + changePath.getCopySrcPath());
} catch (MalformedURLException e) {
}
}
}
}
}
return url;
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class SvnWizardSwitchPage method showLog.
protected void showLog() {
ISVNRemoteResource remoteResource = null;
try {
remoteResource = SVNWorkspaceRoot.getSVNResourceFor(resources[0]).getRepository().getRemoteFile(new SVNUrl(urlCombo.getText()));
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), // $NON-NLS-1$
e.toString());
return;
}
if (remoteResource == null) {
MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), Policy.bind("MergeDialog.urlError") + " " + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
urlCombo.getText());
return;
}
HistoryDialog dialog = new HistoryDialog(getShell(), remoteResource);
if (dialog.open() == HistoryDialog.CANCEL)
return;
ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
if (selectedEntries.length == 0)
return;
revisionText.setText(Long.toString(selectedEntries[selectedEntries.length - 1].getRevision().getNumber()));
setPageComplete(canFinish());
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class SvnWizardAnnotatePage method showLog.
private void showLog(Text text) {
HistoryDialog dialog = new HistoryDialog(getShell(), svnResource);
if (dialog.open() == HistoryDialog.CANCEL)
return;
ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
if (selectedEntries.length == 0)
return;
if ((text == fromRevisionText) || ((text == null) && (fromRevisionText.getText().trim().length() == 0))) {
fromRevisionText.setText(Long.toString(selectedEntries[0].getRevision().getNumber()));
fromRevisionText.setEnabled(true);
}
if (text == toRevisionText) {
toRevisionText.setText(Long.toString(selectedEntries[0].getRevision().getNumber()));
toRevisionButton.setSelection(true);
toHeadButton.setSelection(false);
toRevisionText.setEnabled(true);
}
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class SvnWizardBranchTagPage method showLog.
protected void showLog() {
ISVNRemoteResource remoteResource = null;
if (resource == null)
remoteResource = this.remoteResource;
else {
try {
remoteResource = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getRemoteFile(url);
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), // $NON-NLS-1$
e.toString());
return;
}
}
if (remoteResource == null) {
MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), Policy.bind("MergeDialog.urlError") + " " + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
toUrlCombo.getText());
return;
}
HistoryDialog dialog = new HistoryDialog(getShell(), remoteResource);
if (dialog.open() == HistoryDialog.CANCEL)
return;
ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
if (selectedEntries.length == 0)
return;
revisionText.setText(Long.toString(selectedEntries[selectedEntries.length - 1].getRevision().getNumber()));
setPageComplete(canFinish());
}
Aggregations