use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class MergeWizardUnblockRevisionsPage method getLogEntries.
private void getLogEntries() {
entryArray = new ArrayList();
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
monitor.setTaskName(Messages.MergeWizardUnblockRevisionsPage_retrievingRevisionLogInfo);
monitor.beginTask(Messages.MergeWizardUnblockRevisionsPage_retrievingRevisionLogInfo, 3);
if (SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_SHOW_TAGS_IN_REMOTE))
tagManager = new AliasManager(remoteResource.getUrl());
SVNRevision pegRevision = remoteResource.getRevision();
monitor.worked(1);
for (int i = 0; i < revisionRanges.length; i++) {
rangeEntries = getLogEntries(pegRevision, revisionRanges[i].getFromRevision(), revisionRanges[i].getToRevision(), true, 0, tagManager, true);
monitor.worked(1);
for (int j = 0; j < rangeEntries.length; j++) {
entryArray.add(rangeEntries[j]);
}
}
entries = new ILogEntry[entryArray.size()];
entryArray.toArray(entries);
} catch (Exception e) {
setErrorMessage(e.getMessage());
entries = new ILogEntry[0];
}
monitor.worked(1);
monitor.done();
}
};
try {
getContainer().run(false, false, runnable);
} catch (Exception e1) {
Activator.handleError(e1);
}
setErrorMessage(standardPage.getErrorMessage());
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class StandardMergeInputProvider method performMerge.
public boolean performMerge(MergeWizardMainPage mainPage, MergeWizardLastPage optionsPage, IWorkbenchPart targetPart) {
String commonRoot = standardPage.getCommonRoot(false);
String mergeFrom = standardPage.getMergeFrom();
Activator.getDefault().saveMergeSource(mergeFrom, commonRoot);
IResource[] resources = standardPage.getResources();
SVNUrl[] urls = standardPage.getUrls();
SVNRevisionRange[] revisions = null;
if (standardPage.selectRevisions()) {
Set<IResource> usedResources = new HashSet<IResource>();
Map<SVNRevision.Number, List<IResource>> map = revisionsPage.getRevisionToResource();
revisions = revisionsPage.getRevisions();
CommentsManager commentsManager = SVNUIPlugin.getPlugin().getRepositoryManager().getCommentsManager();
ILogEntry[] entries = revisionsPage.getSelectedLogEntries();
for (int i = 0; i < entries.length; i++) {
commentsManager.addComment(entries[i].getComment());
if (map.size() > 0) {
List<IResource> lst = map.get(entries[i].getRevision());
usedResources.addAll(lst);
}
}
// only filter the urls if the usedResources does have content.
if (usedResources.size() > 0) {
List<SVNUrl> urlsList = new ArrayList<SVNUrl>();
List<IResource> resourcesList = new ArrayList<IResource>();
for (int i = 0; i < resources.length; i++) {
if (usedResources.contains(resources[i])) {
urlsList.add(urls[i]);
resourcesList.add(resources[i]);
}
}
resources = resourcesList.toArray(new IResource[resourcesList.size()]);
urls = urlsList.toArray(new SVNUrl[urlsList.size()]);
}
}
MergeOperation mergeOperation = new MergeOperation(targetPart, resources, urls, null, urls, null, revisions, null);
mergeOperation.setForce(optionsPage.isForce());
mergeOperation.setIgnoreAncestry(optionsPage.isIgnore());
mergeOperation.setDepth(optionsPage.getDepth());
mergeOperation.setTextConflictHandling(optionsPage.getTextConflictHandling());
mergeOperation.setBinaryConflictHandling(optionsPage.getBinaryConflictHandling());
mergeOperation.setPropertyConflictHandling(optionsPage.getPropertyConflictHandling());
mergeOperation.setTreeConflictHandling(optionsPage.getTreeConflictHandling());
try {
mergeOperation.run();
} catch (Exception e) {
Activator.handleError(Messages.StandardMergeInputProvider_error, e);
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.StandardMergeInputProvider_merge, e.getMessage());
return false;
}
return true;
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class FilterRevisionsDialog method showLog.
private void showLog(Text revisionText) {
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()));
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class OpenBugUrlAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
Object[] selectedObjects = selection.toArray();
HashSet urlsSet = new HashSet();
for (int i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i] instanceof ILogEntry) {
ILogEntry logEntry = (ILogEntry) selectedObjects[i];
try {
ProjectProperties projectProperties = ProjectProperties.getProjectProperties(logEntry.getResource().getResource());
LinkList linkList = projectProperties.getLinkList(logEntry.getComment());
String[] urls = linkList.getUrls();
for (int j = 0; j < urls.length; j++) {
urlsSet.add(urls[j]);
}
} catch (Exception e) {
handle(e, null, null);
}
}
}
int i = 0;
Iterator it = urlsSet.iterator();
while (it.hasNext()) {
try {
PlatformUI.getWorkbench().getBrowserSupport().createBrowser("bugurlbrowser" + (i++)).openURL(new URL((String) it.next()));
} catch (Exception e) {
handle(e, null, null);
}
}
return;
}
use of org.tigris.subversion.subclipse.core.history.ILogEntry in project subclipse by subclipse.
the class ShowDifferencesAsUnifiedDiffAction method isEnabled.
protected boolean isEnabled() throws TeamException {
Object[] selectedObjects = selection.toArray();
if (selectedObjects.length == 0 || selectedObjects.length > 2)
return false;
ISVNResource svnResource1 = null;
ISVNResource svnResource2 = null;
if (selectedObjects[0] instanceof ISVNResource)
svnResource1 = (ISVNResource) selectedObjects[0];
else {
if (selectedObjects[0] instanceof ILogEntry)
svnResource1 = ((ILogEntry) selectedObjects[0]).getResource();
}
if (svnResource1 == null)
return false;
if (selectedObjects.length > 1) {
if (selectedObjects[1] instanceof ISVNResource)
svnResource2 = (ISVNResource) selectedObjects[1];
else {
if (selectedObjects[1] instanceof ILogEntry)
svnResource2 = ((ILogEntry) selectedObjects[1]).getResource();
}
if (!svnResource1.getRepository().getRepositoryRoot().toString().equals(svnResource2.getRepository().getRepositoryRoot().toString()))
return false;
return (svnResource1.isFolder() == svnResource2.isFolder());
}
return true;
}
Aggregations