コード例 #1
0
 @Override
 public boolean dvcsUsedInProject() {
   AbstractVcs[] allActiveVcss = getAllActiveVcss();
   for (AbstractVcs activeVcs : allActiveVcss) {
     if (VcsType.distributed.equals(activeVcs.getType())) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
 @Override
 public AbstractVcs getActiveVcs() {
   AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(myProject).getAllActiveVcss();
   if (vcss.length == 0) return null;
   for (AbstractVcs vcs : vcss) {
     if (vcs.getType() == VcsType.distributed) {
       return vcs;
     }
   }
   return vcss[0];
 }
コード例 #3
0
 private void baseRevisionsOfDvcsIntoContext(
     List<Change> textChanges, CommitContext commitContext) {
   ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
   if (vcsManager.dvcsUsedInProject()
       && VcsConfiguration.getInstance(myProject).INCLUDE_TEXT_INTO_SHELF) {
     final Set<Change> big = SelectFilesToAddTextsToPatchPanel.getBig(textChanges);
     final ArrayList<FilePath> toKeep = new ArrayList<FilePath>();
     for (Change change : textChanges) {
       if (change.getBeforeRevision() == null || change.getAfterRevision() == null) continue;
       if (big.contains(change)) continue;
       FilePath filePath = ChangesUtil.getFilePath(change);
       final AbstractVcs vcs = vcsManager.getVcsFor(filePath);
       if (vcs != null && VcsType.distibuted.equals(vcs.getType())) {
         toKeep.add(filePath);
       }
     }
     commitContext.putUserData(BaseRevisionTextPatchEP.ourPutBaseRevisionTextKey, true);
     commitContext.putUserData(BaseRevisionTextPatchEP.ourBaseRevisionPaths, toKeep);
   }
 }