Пример #1
0
 /**
  * @return <code>true</code> if
  *     <ul>
  *       <li>the project != null and
  *       <li>the project contains at least one CVS versioned source group
  *     </ul>
  *     otherwise <code>false</code>.
  * @param checkStatus if set to true, cache.getStatus is called and can take significant amount of
  *     time
  */
 public static boolean isVersionedProject(Project project, boolean checkStatus) {
   if (project != null) {
     FileStatusCache cache = CvsVersioningSystem.getInstance().getStatusCache();
     Sources sources = ProjectUtils.getSources(project);
     SourceGroup[] sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);
     for (int j = 0; j < sourceGroups.length; j++) {
       SourceGroup sourceGroup = sourceGroups[j];
       File f = FileUtil.toFile(sourceGroup.getRootFolder());
       if (f != null) {
         if (checkStatus
             && (cache.getStatus(f).getStatus() & FileInformation.STATUS_MANAGED) != 0) {
           return true;
         } else if (!checkStatus && CvsVersioningSystem.isManaged(f)) {
           return true;
         }
       }
     }
   }
   return false;
 }