use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class TagsHelper method chooseFrom.
@Nullable
private static String chooseFrom(Collection<String> tags, Collection<CvsRevisionNumber> revisions) {
if (tags == null)
return null;
final Collection<String> revisionsNames = collectSortedRevisionsNames(revisions);
if (tags.isEmpty() && revisionsNames.isEmpty()) {
Messages.showMessageDialog(CvsBundle.message("message.no.tags.found"), CvsBundle.message("operation.name.select.tag"), Messages.getInformationIcon());
return null;
}
final SelectTagDialog selectTagDialog = new SelectTagDialog(collectSortedTags(tags), revisionsNames);
if (selectTagDialog.showAndGet()) {
return selectTagDialog.getTag();
}
return null;
}
use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class GetFileContentOperation method gotEntry.
public void gotEntry(FileObject abstractFileObject, Entry entry) {
super.gotEntry(abstractFileObject, entry);
if (entry == null) {
myState = DELETED;
myFileBytes = ArrayUtil.EMPTY_BYTE_ARRAY;
} else {
myRevision = entry.getRevision();
myCvsRevisionNumber = new CvsRevisionNumber(myRevision);
}
}
use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class CvsDiffProvider method getLastState.
private ItemLatestState getLastState(final VirtualFile parent, final String name) {
final Entry entry = CvsEntriesManager.getInstance().getEntryFor(parent, name);
if (entry == null)
return new ItemLatestState(new CvsRevisionNumber("HEAD"), true, true);
final String stickyHead = new StickyHeadGetter.MyStickyBranchHeadGetter(entry.getRevision(), myProject).getHead(parent, name);
if (stickyHead == null) {
return new ItemLatestState(new CvsRevisionNumber("HEAD"), true, true);
}
return new ItemLatestState(new CvsRevisionNumber(stickyHead), (!entry.isRemoved()), false);
}
use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class CvsDiffProvider method createFileContent.
public ContentRevision createFileContent(final VcsRevisionNumber revisionNumber, VirtualFile selectedFile) {
if ((revisionNumber instanceof CvsRevisionNumber)) {
final CvsConnectionSettings settings = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(selectedFile.getParent());
final File file = new File(CvsUtil.getModuleName(selectedFile));
final CvsRevisionNumber cvsRevisionNumber = ((CvsRevisionNumber) revisionNumber);
final RevisionOrDate versionInfo;
if (cvsRevisionNumber.getDateOrRevision() != null) {
versionInfo = RevisionOrDateImpl.createOn(cvsRevisionNumber.getDateOrRevision());
} else {
versionInfo = new SimpleRevision(cvsRevisionNumber.asString());
}
if (selectedFile.getFileType().isBinary()) {
return new CvsBinaryContentRevision(file, file, versionInfo, settings, myProject);
} else {
return new CvsContentRevision(file, file, versionInfo, settings, myProject);
}
} else {
return null;
}
}
use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class StickyHeadGetter method getTagStart.
@Nullable
private static String getTagStart(final String currentRevision) {
final int[] subRevisions = new CvsRevisionNumber(currentRevision).getSubRevisions();
if (subRevisions == null || subRevisions.length < 2)
return null;
final int[] top = new int[subRevisions.length - 1];
System.arraycopy(subRevisions, 0, top, 0, subRevisions.length - 1);
return StringUtil.join(top, ".");
}
Aggregations