use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class CvsChangeList method isAdded.
private static boolean isAdded(final Revision revision) {
final String revisionState = revision.getState();
if (EXP_STATE.equals(revisionState) && revision.getLines() == null) {
return true;
}
if (ADDED_STATE.equals(revisionState)) {
return true;
}
// files added on branch
final int[] subRevisions = new CvsRevisionNumber(revision.getNumber()).getSubRevisions();
if (subRevisions != null && subRevisions.length > 2 && subRevisions[subRevisions.length - 1] == 1) {
return true;
}
return false;
}
use of com.intellij.cvsSupport2.history.CvsRevisionNumber in project intellij-community by JetBrains.
the class CvsCommittedChangesProvider method isChangeLocallyAvailable.
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);
}
Aggregations