本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}