当前位置: 首页>>代码示例>>Java>>正文


Java VcsRevisionNumber.compareTo方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.history.VcsRevisionNumber.compareTo方法的典型用法代码示例。如果您正苦于以下问题:Java VcsRevisionNumber.compareTo方法的具体用法?Java VcsRevisionNumber.compareTo怎么用?Java VcsRevisionNumber.compareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.history.VcsRevisionNumber的用法示例。


在下文中一共展示了VcsRevisionNumber.compareTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processFile

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
private static boolean processFile(final FilePath path,
                                   final VcsRevisionNumber number,
                                   final List<IncomingChangeListData> incomingData,
                                   final ReceivedChangeListTracker tracker) {
  boolean foundRevision = false;
  debug("Processing updated file " + path + ", revision " + number);
  for(IncomingChangeListData data: incomingData) {
    for(Change change: data.changeList.getChanges()) {
      ContentRevision afterRevision = change.getAfterRevision();
      if (afterRevision != null && afterRevision.getFile().equals(path)) {
        int rc = number.compareTo(afterRevision.getRevisionNumber());
        if (rc == 0) {
          foundRevision = true;
        }
        if (rc >= 0) {
          tracker.addChange(data.changeList, change);
          data.accountedChanges.add(change);
        }
      }
    }
  }
  debug(foundRevision ? "All changes for file found" : "Some of changes for file not found");
  return !foundRevision;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ChangesCacheFile.java

示例2: compute

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
public Boolean compute() {
  final AbstractVcs vcs = myVcsRoot.getVcs();
  // won't be called in parallel for same vcs -> just synchronized map is ok
  final String vcsName = vcs.getName();
  LOG.debug("should update for: " + vcsName + " root: " + myVcsRoot.getPath().getPath());
  final VcsRevisionNumber latestNew = vcs.getDiffProvider().getLatestCommittedRevision(myVcsRoot.getPath());

  // TODO: Why vcsName is used as key and not myVcsRoot.getKey()???
  // TODO: This seems to be invalid logic as we get latest revision for vcs root
  final VcsRevisionNumber latestKnown = myLatestRevisionsMap.get(vcsName);
  // not known
  if (latestNew == null) return true;
  if ((latestKnown == null) || (latestNew.compareTo(latestKnown) != 0)) {
    myLatestRevisionsMap.put(vcsName, latestNew);
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RemoteRevisionsNumbersCache.java

示例3: isChangeLocallyAvailable

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
public boolean isChangeLocallyAvailable(final FilePath filePath, @Nullable VcsRevisionNumber localRevision,
                                        VcsRevisionNumber changeRevision, final CvsChangeList changeList) {
  if (localRevision instanceof CvsRevisionNumber && changeRevision instanceof CvsRevisionNumber) {
    final CvsRevisionNumber cvsLocalRevision = (CvsRevisionNumber)localRevision;
    final CvsRevisionNumber cvsChangeRevision = (CvsRevisionNumber)changeRevision;
    final int[] localSubRevisions = cvsLocalRevision.getSubRevisions();
    final int[] changeSubRevisions = cvsChangeRevision.getSubRevisions();
    if (localSubRevisions != null && changeSubRevisions != null) {
      if (localSubRevisions.length != changeSubRevisions.length) {
        // local is trunk, change is branch / vice versa
        return true;
      }
      for(int i=2; i<localSubRevisions.length; i += 2) {
        if (localSubRevisions [i] != changeSubRevisions [i]) {
          // local is one branch, change is a different branch
          return true;
        }
      }
    }
  }

  return isDifferentBranch(filePath, changeList) || (localRevision != null && localRevision.compareTo(changeRevision) >= 0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CvsCommittedChangesProvider.java

示例4: sameBeforeRevision

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
private static boolean sameBeforeRevision(final Change change1, final Change change2) {
  final ContentRevision b1 = change1.getBeforeRevision();
  final ContentRevision b2 = change2.getBeforeRevision();
  if (b1 != null && b2 != null) {
    final VcsRevisionNumber rn1 = b1.getRevisionNumber();
    final VcsRevisionNumber rn2 = b2.getRevisionNumber();
    final boolean isBinary1 = (b1 instanceof BinaryContentRevision);
    final boolean isBinary2 = (b2 instanceof BinaryContentRevision);
    return rn1 != VcsRevisionNumber.NULL && rn2 != VcsRevisionNumber.NULL && rn1.compareTo(rn2) == 0 && isBinary1 == isBinary2;
  }
  return b1 == null && b2 == null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LocalChangeListImpl.java

示例5: getRevisionState

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
/**
 * Returns {@code true} if passed revision is up to date, comparing to latest repository revision.
 */
private boolean getRevisionState(final ContentRevision revision) {
  if (revision != null) {
    // TODO: Seems peg revision should also be tracked here.
    final VcsRevisionNumber local = revision.getRevisionNumber();
    final String path = revision.getFile().getIOFile().getAbsolutePath();
    final VcsRevisionNumber remote = getNumber(path);

    return NOT_LOADED == remote || UNKNOWN == remote || local.compareTo(remote) >= 0;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:RemoteRevisionsNumbersCache.java

示例6: isChangeLocallyAvailable

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
public boolean isChangeLocallyAvailable(FilePath filePath,
                                        @Nullable VcsRevisionNumber localRevision,
                                        VcsRevisionNumber changeRevision,
                                        CommittedChangeList committedChangeList) {
  return localRevision != null && localRevision.compareTo(changeRevision) >= 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:HgCachingCommittedChangesProvider.java

示例7: isChangeLocallyAvailable

import com.intellij.openapi.vcs.history.VcsRevisionNumber; //导入方法依赖的package包/类
public boolean isChangeLocallyAvailable(FilePath filePath, @Nullable VcsRevisionNumber localRevision, VcsRevisionNumber changeRevision,
                                        final SvnChangeList changeList) {
  return localRevision != null && localRevision.compareTo(changeRevision) >= 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SvnCommittedChangesProvider.java


注:本文中的com.intellij.openapi.vcs.history.VcsRevisionNumber.compareTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。