Search in sources :

Example 6 with CvsRevisionNumber

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;
}
Also used : SelectTagDialog(com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.SelectTagDialog) Nullable(org.jetbrains.annotations.Nullable)

Example 7 with CvsRevisionNumber

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);
    }
}
Also used : CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber)

Example 8 with CvsRevisionNumber

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);
}
Also used : Entry(org.netbeans.lib.cvsclient.admin.Entry) ItemLatestState(com.intellij.openapi.vcs.diff.ItemLatestState) CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber)

Example 9 with CvsRevisionNumber

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;
    }
}
Also used : CvsContentRevision(com.intellij.cvsSupport2.changeBrowser.CvsContentRevision) CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) CvsBinaryContentRevision(com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision) RevisionOrDate(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber) SimpleRevision(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)

Example 10 with CvsRevisionNumber

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, ".");
}
Also used : CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CvsRevisionNumber (com.intellij.cvsSupport2.history.CvsRevisionNumber)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 Nullable (org.jetbrains.annotations.Nullable)4 File (java.io.File)3 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)2 CvsBinaryContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision)1 CvsContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsContentRevision)1 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)1 CvsExecutionEnvironment (com.intellij.cvsSupport2.cvsoperations.common.CvsExecutionEnvironment)1 ErrorProcessor (com.intellij.cvsSupport2.cvsoperations.cvsErrors.ErrorProcessor)1 LocalPathIndifferentLogOperation (com.intellij.cvsSupport2.cvsoperations.cvsLog.LocalPathIndifferentLogOperation)1 CvsMessagesAdapter (com.intellij.cvsSupport2.cvsoperations.cvsMessages.CvsMessagesAdapter)1 SelectTagDialog (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.SelectTagDialog)1 RevisionOrDate (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate)1 Ref (com.intellij.openapi.util.Ref)1 VcsException (com.intellij.openapi.vcs.VcsException)1 Change (com.intellij.openapi.vcs.changes.Change)1 ContentRevision (com.intellij.openapi.vcs.changes.ContentRevision)1 ItemLatestState (com.intellij.openapi.vcs.diff.ItemLatestState)1 FileGroup (com.intellij.openapi.vcs.update.FileGroup)1