Package com.intellij.openapi.vcs

Examples of com.intellij.openapi.vcs.AbstractVcs


    if ((fileScope.getVcsBeforeRev() == null) && (fileScope.getVcsAfterRev() == null))
    {
      return true;
    }

    AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(vFile);
    if (vcs == null)
    {
      return true;
    }

    try
    {
      VcsRevisionNumber vcsRevisionNumber;
      if (fileScope.getVcsBeforeRev() != null)
      {
        vcsRevisionNumber = vcs.parseRevisionNumber(fileScope.getVcsBeforeRev());

        // Strict Before
        if ((vcsRevisionNumber != null) && rev.compareTo(vcsRevisionNumber) <= 0)
        {
          return false;
        }
      }

      if (fileScope.getVcsAfterRev() == null)
      {
        return true;
      }
        vcsRevisionNumber = vcs.parseRevisionNumber(fileScope.getVcsAfterRev(), new FilePathImpl(vFile));
        return (vcsRevisionNumber == null) || rev.compareTo(vcsRevisionNumber) > 0;
    }
    catch (Exception ignored)
    {
      if (LOGGER.isDebugEnabled())
View Full Code Here


  }

  @Override
  public void actionPerformed(AnActionEvent e)
  {
    AbstractVcs vcs = getVcs(e);

    Project project = e.getData(PlatformDataKeys.PROJECT);
    VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);

    final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(vFile);
    if ((filePath == null) || (!vcs.fileIsUnderVcs(filePath)))
    {
      return;
    }

    Review review = RevuUtils.getReviewingReview(project);

    VcsRevisionNumber revision;
    if (review.getFileScope().getVcsAfterRev() != null)
    {
      try
      {
        revision = vcs.parseRevisionNumber(review.getFileScope().getVcsAfterRev());
      }
      catch (VcsException ex)
      {
        LOGGER.error("Failed to parse VCS revision: " + review.getFileScope().getVcsAfterRev());
        return;
      }
    }
    else
    {
      ItemLatestState itemLatestState = vcs.getDiffProvider().getLastRevision(vFile);
      if (itemLatestState == null)
      {
        return;
      }

      revision = itemLatestState.getNumber();
    }
   
    DiffActionExecutor.showDiff(vcs.getDiffProvider(), revision, vFile, project,
      VcsBackgroundableActions.COMPARE_WITH);
  }
View Full Code Here

        throw new RevuFriendlyException("Failed to get DiffProvider: " + vFile,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.noVcs.details.text",
          vFile.getPath()));
      }

      AbstractVcs vcs = VcsUtil.getVcsFor(project, vFile);
      assert vcs != null;

      VcsRevisionNumber vcsRevisionNumber;
      try
      {
        vcsRevisionNumber = vcs.parseRevisionNumber(rev);
      }
      catch (VcsException e)
      {
        throw new RevuFriendlyException("Failed to parse VCS revision number: " + rev,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.invalidRevision.details.text",
View Full Code Here

    if ((fileScope.getVcsBeforeRev() == null) && (fileScope.getVcsAfterRev() == null))
    {
      return true;
    }

    AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(vFile);
    if (vcs == null)
    {
      return true;
    }

    try
    {
      if ((fileScope.getVcsBeforeRev() != null)
        && (rev.compareTo(vcs.parseRevisionNumber(fileScope.getVcsBeforeRev())) < 0))
      {
        return false;
      }

      return ((fileScope.getVcsAfterRev() == null)
        || (rev.compareTo(vcs.parseRevisionNumber(fileScope.getVcsAfterRev())) >= 0));
    }
    catch (Exception ignored)
    {
      if (LOGGER.isDebugEnabled())
      {
View Full Code Here

  }

  @Override
  public void actionPerformed(AnActionEvent e)
  {
    AbstractVcs vcs = getVcs(e);

    Project project = e.getData(DataKeys.PROJECT);
    VirtualFile vFile = e.getData(DataKeys.VIRTUAL_FILE);

    final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(vFile);
    if ((filePath == null) || (!vcs.fileIsUnderVcs(filePath)))
    {
      return;
    }

    Review review = RevuUtils.getReviewingReview(project);

    VcsRevisionNumber revision;
    if (review.getFileScope().getVcsAfterRev() != null)
    {
      revision = vcs.parseRevisionNumber(review.getFileScope().getVcsAfterRev());
    }
    else
    {
      ItemLatestState itemLatestState = vcs.getDiffProvider().getLastRevision(vFile);
      if (itemLatestState == null)
      {
        return;
      }

      revision = itemLatestState.getNumber();
    }
   
    DiffActionExecutor.showDiff(vcs.getDiffProvider(), revision, vFile, project,
      VcsBackgroundableActions.COMPARE_WITH);
  }
View Full Code Here

        throw new RevuFriendlyException("Failed to get DiffProvider: " + vFile,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.noVcs.details.text",
          vFile.getPath()));
      }

      AbstractVcs vcs = VcsUtil.getVcsFor(project, vFile);
      assert vcs != null;

      VcsRevisionNumber vcsRevisionNumber = vcs.parseRevisionNumber(rev);
      if (vcsRevisionNumber == null)
      {
        throw new RevuFriendlyException("Failed to parse VCS revision number: " + rev,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.invalidRevision.details.text",
          vFile.getPath(), rev));
View Full Code Here

    AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
    if (vcss.length > 0)
    {
      // @TODO handle case where projet has several VCS roots
      // Here, I use the first VCS connection
      AbstractVcs vcs = vcss[0];
      if (ckVcsAfterRev.isSelected())
      {
        updateError(tfVcsAfterRev, !RevuVcsUtils.isRevisionNumberParsable(vcs, tfVcsAfterRev.getText()),
          RevuBundle.message("projectSettings.review.scope.invalidRev.text"));
      }
View Full Code Here

    AbstractVcs[] vcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
    if (vcss.length > 0)
    {
      // @TODO handle case where projet has several VCS roots
      // Here, I use the first VCS connection
      AbstractVcs vcs = vcss[0];
      if (ckVcsAfterRev.isSelected())
      {
        updateError(tfVcsAfterRev, vcs.parseRevisionNumber(tfVcsAfterRev.getText()) == null,
          RevuBundle.message("projectSettings.review.scope.invalidRev.text"));
      }

      if (ckVcsBeforeRev.isSelected())
      {
        updateError(tfVcsBeforeRev, vcs.parseRevisionNumber(tfVcsBeforeRev.getText()) == null,
          RevuBundle.message("projectSettings.review.scope.invalidRev.text"));
      }
    }

    if (scopeEditorPanel.getCurrentScope() != null)
View Full Code Here

        ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
        if (vcsManager == null) {
            Messages.showErrorDialog(project, "VCS is not enabled for project " + project.getName(), ERROR_DIALOG_TITLE);
            return;
        }
        AbstractVcs vcs = vcsManager.getVcsFor(file);
        if (!(vcs instanceof SvnVcs)) {
            Messages.showErrorDialog(project, file.getName() + " is not managed by Subversion", ERROR_DIALOG_TITLE);
            return;
        }
View Full Code Here

  protected void activateVCS(final String vcsName) {
    ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
    vcsManager.setDirectoryMapping(myWorkingCopyDir.getPath(), vcsName);
    vcsManager.updateActiveVcss();

    AbstractVcs vcs = vcsManager.findVcsByName(vcsName);
    Assert.assertEquals(1, vcsManager.getRootsUnderVcs(vcs).length);
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vcs.AbstractVcs

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.