Package com.intellij.openapi.vcs.changes

Examples of com.intellij.openapi.vcs.changes.ContentRevision


    private void removedFiles() throws VcsException {
        Sets.SetView<String> removedFiles = Sets.difference(baseChanges.keySet(), changes.keySet());
        for (String removedFile : removedFiles) {
            Change baseChange = baseChanges.get(removedFile);
            ContentRevision afterRevision = null;
            if (baseChange.getType().equals(Change.Type.MODIFICATION)) {
                ContentRevision baseChangeBeforeRevision = baseChange.getBeforeRevision();
                assert baseChangeBeforeRevision != null;
                afterRevision = new SimpleContentRevision(
                        baseChangeBeforeRevision.getContent(),
                        baseChangeBeforeRevision.getFile(),
                        hash
                );
            }
            diff.add(new Change(baseChange.getAfterRevision(), afterRevision));
        }
View Full Code Here


   *         in this case name of files for "before" and "after" revisions must not
   *         coniside.
   */
  public static boolean isRenameChange(Change change) {
    boolean isRenamed = false;
    ContentRevision before = change.getBeforeRevision();
    ContentRevision after = change.getAfterRevision();
    if (before != null && after != null) {
      String prevFile = getCanonicalLocalPath(before.getFile().getPath());
      String newFile = getCanonicalLocalPath(after.getFile().getPath());
      isRenamed = !prevFile.equals(newFile);
    }
    return isRenamed;
  }
View Full Code Here

  public static boolean isChangeForDeleted(Change change) {
    return (change.getBeforeRevision() != null) && (change.getAfterRevision() == null);
  }

  public static boolean isChangeForFolder(Change change) {
    ContentRevision revB = change.getBeforeRevision();
    ContentRevision revA = change.getAfterRevision();
    return (revA != null && revA.getFile().isDirectory()) || (revB != null && revB.getFile().isDirectory());
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vcs.changes.ContentRevision

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.