use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class ReplaceWithBranchTagWizardMainPage 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 MergeWizardRevisionsPage method refresh.
private void refresh() {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
monitor.setTaskName(Messages.MergeWizardRevisionsPage_retrievingRemoteResource);
monitor.beginTask(Messages.MergeWizardRevisionsPage_retrievingRemoteResource, IProgressMonitor.UNKNOWN);
monitor.worked(1);
remoteResource = repositoryLocation.getRemoteFile(new SVNUrl(getUrl()));
monitor.done();
} catch (Exception e) {
Activator.handleError(e);
}
}
};
setPageComplete(false);
setErrorMessage(null);
fromUrl = standardPage.getFromUrl();
remoteResource = null;
try {
getContainer().run(true, false, runnable);
if (remoteResource == null) {
setErrorMessage(Messages.MergeWizardRevisionsPage_errorRetrievingRemoteResource);
entries = new ILogEntry[0];
} else {
getLogEntries(false, false);
if (noEligibleEntries) {
setErrorMessage(Messages.MergeWizardRevisionsPage_noEligibleRevisions);
}
}
} catch (Exception e) {
Activator.handleError(e);
setErrorMessage(e.getMessage());
entries = new ILogEntry[0];
}
if (tableHistoryViewer.getInput() == null)
tableHistoryViewer.setInput(getUrl());
else
tableHistoryViewer.refresh();
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class MergeWizardRevisionsPage method getLogEntries.
private void getLogEntries(final boolean getAll, final boolean getNext) {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
monitor.setTaskName(Messages.MergeWizardRevisionsPage_retrievingRevisionLogInfo);
monitor.beginTask(Messages.MergeWizardRevisionsPage_retrievingRevisionLogInfo, 5);
if (SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_SHOW_TAGS_IN_REMOTE))
tagManager = new AliasManager(remoteResource.getUrl());
monitor.worked(1);
noEligibleEntries = false;
entries = getEligibleLogEntries(monitor);
monitor.worked(1);
if (entries == null || entries.length == 0)
noEligibleEntries = true;
monitor.worked(1);
} catch (Exception e) {
Activator.handleError(e);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
setErrorMessage(Messages.MergeWizardChangeSetRevisionsPage_errorRetrievingLogEntries);
}
});
entries = new ILogEntry[0];
}
monitor.worked(1);
monitor.done();
}
};
try {
getContainer().run(true, false, runnable);
} catch (Exception e1) {
Activator.handleError(e1);
}
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class MergeWizardRevisionsPage method getSelectionListener.
private SelectionListener getSelectionListener() {
SelectionListener selectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.getSource() == MergeWizardRevisionsPage.this.moreOptionsButton) {
if (dialog == null) {
final TreeSet<String> set = new TreeSet<String>();
if (entries != null && entries.length > 0) {
set.add(ALL_AUTHORS);
for (int i = 0; i < entries.length; i++) {
if (entries[i].getAuthor() != null) {
set.add(entries[i].getAuthor());
}
}
if (set.size() == 2) {
set.remove(ALL_AUTHORS);
}
}
dialog = new FilterRevisionsDialog(getShell(), set);
}
dialog.setRemoteResource(MergeWizardRevisionsPage.this.remoteResource);
int returnCode = dialog.open();
if (returnCode < 1) {
clearSearchCriteria();
historySearchFilter = new HistorySearchViewerFilter(dialog.getUser(), dialog.getComment(), dialog.getStartDate(), dialog.getEndDate(), dialog.getRegExp(), dialog.getStartRevision(), dialog.getEndRevision());
tableHistoryViewer.setFilters(new ViewerFilter[] { historySearchFilter });
MergeWizardRevisionsPage.this.tableHistoryViewer.refresh();
TableItem[] items = tableHistoryViewer.getTable().getItems();
for (TableItem item : items) {
ILogEntry entry = adaptToLogEntry(item.getData());
if (entry != null) {
historySearchFilter.select(tableHistoryViewer, null, entry);
}
}
showMessage();
setPageComplete(canFinish());
}
}
}
private void clearSearchCriteria() {
filterText.setText("");
}
};
return selectionListener;
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class MergeWizardUnblockRevisionsPage method refresh.
private void refresh() {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
monitor.setTaskName(Messages.MergeWizardUnblockRevisionsPage_retrievingRemoteResource);
monitor.beginTask(Messages.MergeWizardUnblockRevisionsPage_retrievingRemoteResource, 2);
monitor.worked(1);
remoteResource = repositoryLocation.getRemoteFile(new SVNUrl(fromUrl));
monitor.worked(1);
monitor.done();
} catch (Exception e) {
Activator.handleError(e);
}
}
};
setPageComplete(false);
setErrorMessage(null);
fromUrl = standardPage.getFromUrl();
ISVNMergeInfo mergeInfo = standardPage.getMergeInfo();
if (mergeInfo == null) {
entries = new ILogEntry[0];
return;
}
revisionRanges = mergeInfo.getRevisionRange(fromUrl);
remoteResource = null;
try {
getContainer().run(false, false, runnable);
if (remoteResource == null) {
setErrorMessage(Messages.MergeWizardUnblockRevisionsPage_errorRetrievingRemoteResource);
entries = new ILogEntry[0];
} else
getLogEntries();
} catch (Exception e) {
setErrorMessage(e.getMessage());
entries = new ILogEntry[0];
}
if (tableHistoryViewer.getInput() == null)
tableHistoryViewer.setInput(fromUrl);
else
tableHistoryViewer.refresh();
setPageComplete(canFinish());
}
Aggregations