Search in sources :

Example 6 with CvsEntriesManager

use of com.intellij.cvsSupport2.application.CvsEntriesManager in project intellij-community by JetBrains.

the class CvsCommittedChangesProvider method isDifferentBranch.

private static boolean isDifferentBranch(final FilePath filePath, final CvsChangeList changeList) {
    final String localTag;
    final CvsEntriesManager cvsEntriesManager = CvsEntriesManager.getInstance();
    final VirtualFile parent = filePath.getVirtualFileParent();
    if (parent != null) {
        final Entry entry = cvsEntriesManager.getEntryFor(parent, filePath.getName());
        if (entry != null) {
            localTag = entry.getStickyTag();
        } else {
            localTag = getDirectoryTag(parent);
        }
    } else {
        final VirtualFile validParent = ChangesUtil.findValidParentAccurately(filePath);
        if (validParent == null)
            return false;
        localTag = getDirectoryTag(validParent);
    }
    final String remoteTag = changeList.getBranch();
    if (!Comparing.equal(localTag, remoteTag)) {
        if (LOG.isDebugEnabled())
            LOG.info(filePath + ": local tag " + localTag + ", remote tag " + remoteTag);
        return true;
    }
    return false;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Entry(org.netbeans.lib.cvsclient.admin.Entry) CvsEntriesManager(com.intellij.cvsSupport2.application.CvsEntriesManager)

Aggregations

CvsEntriesManager (com.intellij.cvsSupport2.application.CvsEntriesManager)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)2 File (java.io.File)2 Entry (org.netbeans.lib.cvsclient.admin.Entry)2 CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)1 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 CvsInfo (com.intellij.cvsSupport2.application.CvsInfo)1 IgnoreFileFilterBasedOnCvsEntriesManager (com.intellij.cvsSupport2.cvsIgnore.IgnoreFileFilterBasedOnCvsEntriesManager)1 AnnotateOperation (com.intellij.cvsSupport2.cvsoperations.cvsAnnotate.AnnotateOperation)1 Annotation (com.intellij.cvsSupport2.cvsoperations.cvsAnnotate.Annotation)1 CheckoutProjectOperation (com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation)1 CvsMessagesListener (com.intellij.cvsSupport2.cvsoperations.cvsMessages.CvsMessagesListener)1 CvsMessagesTranslator (com.intellij.cvsSupport2.cvsoperations.cvsMessages.CvsMessagesTranslator)1 FilePath (com.intellij.openapi.vcs.FilePath)1 FileAnnotation (com.intellij.openapi.vcs.annotate.FileAnnotation)1 VcsFileRevision (com.intellij.openapi.vcs.history.VcsFileRevision)1 IOException (java.io.IOException)1 IClientEnvironment (org.netbeans.lib.cvsclient.IClientEnvironment)1 IRequestProcessor (org.netbeans.lib.cvsclient.IRequestProcessor)1