예제 #1
0
파일: Excludes.java 프로젝트: jonas/nbgit
  public static boolean isIgnored(File file, boolean checkSharability) {
    if (file == null) {
      return false;
    }

    File topFile = Git.getInstance().getTopmostManagedParent(file);
    // We assume that the toplevel directory should not be ignored.
    if (topFile == null || topFile.equals(file)) {
      return false; // We assume that the Project should not be ignored.
    }
    if (file.isDirectory()) {
      ProjectManager projectManager = ProjectManager.getDefault();
      if (projectManager.isProject(FileUtil.toFileObject(file))) {
        return false;
      }
    }

    Repository repo = Git.getInstance().getRepository(topFile);
    ExcludeCache cache = getCache(repo);
    if (cache.isExcluded(file)) return true;

    if (file.getName().equals(".gitignore")
        || file.getName().equals(".gitattributes")
        || file.getName().equals(".gitmodules")) return false;

    if (checkSharability && !isSharable(file)) {
      return true;
    }
    return false;
  }
예제 #2
0
  private void onRefreshButton() {
    if (context == null || context.getRootFiles().size() == 0) {
      return;
    }

    if (executeStatusSupport != null) {
      executeStatusSupport.cancel();
      executeStatusSupport = null;
    }

    LifecycleManager.getDefault().saveAll();
    RequestProcessor rp = Git.getInstance().getRequestProcessor();
    executeStatusSupport =
        new GitProgressSupport() {

          public void perform() {
            StatusAction.executeStatus(context, this);
            SwingUtilities.invokeLater(
                new Runnable() {

                  public void run() {
                    refreshSetups();
                  }
                });
          }
        };
    String repository = GitUtils.getRootPath(context);
    executeStatusSupport.start(
        rp, repository, NbBundle.getMessage(MultiDiffPanel.class, "MSG_Refresh_Progress"));
  }
예제 #3
0
  public static void resolve(VCSContext ctx) {
    StatusCache cache = Git.getInstance().getStatusCache();
    File[] files = cache.listFiles(ctx, StatusInfo.STATUS_VERSIONED_CONFLICT);

    resolveConflicts(files);

    return;
  }
예제 #4
0
 @Override
 public void addNotify() {
   super.addNotify();
   if (refreshTask != null) {
     Git.getInstance().getStatusCache().addPropertyChangeListener(this);
   }
   JComponent parent = (JComponent) getParent();
   parent.getActionMap().put("jumpNext", nextAction); // NOI18N
   parent.getActionMap().put("jumpPrev", prevAction); // NOI18N
 }
예제 #5
0
 @Override
 public boolean isEnabled() {
   StatusCache cache = Git.getInstance().getStatusCache();
   return cache.containsFileOfStatus(context, StatusInfo.STATUS_VERSIONED_CONFLICT);
 }
예제 #6
0
 public SetupsComparator() {
   cache = Git.getInstance().getStatusCache();
 }
예제 #7
0
 @Override
 public void removeNotify() {
   Git.getInstance().getStatusCache().removePropertyChangeListener(this);
   super.removeNotify();
 }