use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.
the class BranchTagOperation method updateBranchTagProperty.
private void updateBranchTagProperty(IResource resource) {
AliasManager aliasManager = new AliasManager(resource, false);
Alias[] branchAliases = aliasManager.getBranches();
Alias[] tagAliases = aliasManager.getTags();
StringBuffer propertyValue = new StringBuffer();
for (int i = 0; i < branchAliases.length; i++) {
if (branchAliases[i].getRevision() > 0) {
// $NON-NLS-1$
if (propertyValue.length() > 0)
propertyValue.append("\n");
Alias branch = branchAliases[i];
// $NON-NLS-1$
propertyValue.append(branch.getRevision() + "," + branch.getName());
if (branch.getRelativePath() != null)
// $NON-NLS-1$
propertyValue.append("," + branch.getRelativePath());
if (// $NON-NLS-1$
branch.isBranch())
// $NON-NLS-1$
propertyValue.append(",branch");
else
// $NON-NLS-1$
propertyValue.append(",tag");
}
}
for (int i = 0; i < tagAliases.length; i++) {
if (tagAliases[i].getRevision() > 0) {
// $NON-NLS-1$
if (propertyValue.length() > 0)
propertyValue.append("\n");
Alias tag = tagAliases[i];
// $NON-NLS-1$
propertyValue.append(tag.getRevision() + "," + tag.getName());
if (tag.getRelativePath() != null)
// $NON-NLS-1$
propertyValue.append("," + tag.getRelativePath());
if (// $NON-NLS-1$
tag.isBranch())
// $NON-NLS-1$
propertyValue.append(",branch");
else
// $NON-NLS-1$
propertyValue.append(",tag");
}
}
// $NON-NLS-1$
if (propertyValue.length() > 0)
propertyValue.append("\n");
propertyValue.append(newAlias.getRevision() + "," + newAlias.getName() + "," + // $NON-NLS-1$ //$NON-NLS-2$
newAlias.getRelativePath());
if (// $NON-NLS-1$
newAlias.isBranch())
// $NON-NLS-1$
propertyValue.append(",branch");
else
// $NON-NLS-1$
propertyValue.append(",tag");
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
// $NON-NLS-1$
svnResource.setSvnProperty("subclipse:tags", propertyValue.toString(), false);
} catch (SVNException e) {
}
}
use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.
the class RemoteContentProvider method setResource.
public void setResource(IResource resource) {
if (includeBranchesAndTags) {
AliasManager tagManager = new AliasManager(resource);
Alias[] branchAliases = tagManager.getBranches();
Alias[] tagAliases = tagManager.getTags();
if (branchAliases.length > 0)
branches = new Branches(branchAliases);
if (tagAliases.length > 0)
tags = new Tags(tagAliases);
}
}
use of org.tigris.subversion.subclipse.core.history.AliasManager 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.AliasManager in project subclipse by subclipse.
the class RevisionDetailsAction method run.
public void run() {
remoteResource = null;
logEntry = null;
includeTags = SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_SHOW_TAGS_IN_REMOTE);
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
try {
RevisionGraphEditorInput input = (RevisionGraphEditorInput) editor.getEditorInput();
ISVNInfo info = input.getInfo();
ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(info.getRepository().toString());
remoteResource = new RemoteFile(repository, new SVNUrl(repository.getLocation() + node.getPath()), new SVNRevision.Number(node.getRevision()));
AliasManager tagManager = null;
if (includeTags)
tagManager = new AliasManager(remoteResource.getUrl());
SVNRevision pegRevision = new SVNRevision.Number(node.getRevision());
SVNRevision revisionStart = new SVNRevision.Number(node.getRevision());
SVNRevision revisionEnd = new SVNRevision.Number(node.getRevision());
GetLogsCommand logCmd = new GetLogsCommand(remoteResource, pegRevision, revisionStart, revisionEnd, false, 0, tagManager, true);
logCmd.run(null);
ILogEntry[] logEntries = logCmd.getLogEntries();
if (logEntries != null && logEntries.length > 0) {
logEntry = logEntries[0];
}
} catch (Exception e) {
MessageDialog.openError(Display.getDefault().getActiveShell(), "Revision Info", e.getMessage());
}
}
});
if (logEntry != null) {
ShowRevisionsDialog dialog = new ShowRevisionsDialog(Display.getDefault().getActiveShell(), logEntry, remoteResource, includeTags, null);
dialog.setTitle("Revision Info");
dialog.setSelectFirst(true);
dialog.open();
}
}
use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.
the class SvnWizardConfigureTagsPage method getBranchesAndTags.
private void getBranchesAndTags() {
AliasManager aliasManager = new AliasManager(svnResources[0].getResource(), false);
Alias[] branchAliases = aliasManager.getBranches();
branches = new Branches(branchAliases);
Alias[] tagAliases = aliasManager.getTags();
tags = new Tags(tagAliases);
}
Aggregations