Package com.intellij.openapi.vcs

Examples of com.intellij.openapi.vcs.FilePath


    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;
    }
View Full Code Here


    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;
    }
View Full Code Here

    final Collection<Change> changeCollection = list.getChanges();
    // (Change[]) DataProvider.getData(DataConstants.CHANGES)
    for (final Change change : changeCollection) {
      final ContentRevision contentRevision = change.getAfterRevision();
      if (contentRevision != null) {
        final FilePath path = contentRevision.getFile();
        result.add(path.getVirtualFile());
      }
    }
    return result;
  }
View Full Code Here

    for (Change change : changes) {
      if (FileStatus.MODIFIED.equals(change.getFileStatus())) {
        ContentRevision afterRevision = change.getAfterRevision();
        if (afterRevision != null) {
          FilePath filePath = afterRevision.getFile();
          modifiedFiles.add(VcsUtil.getVirtualFile(filePath.getIOFile()));
        }

      } else if (FileStatus.ADDED.equals(change.getFileStatus())) {
                addedFiles.add(change.getAfterRevision().getFile().getVirtualFile());
            }else {
View Full Code Here

    private boolean checkSandboxContains(@NotNull final MksSandboxInfo sandbox, @NotNull final VirtualFile virtualFile) {
        if (virtualFile.isDirectory()) {
            throw new IllegalArgumentException("directories don't belong to sandboxes");
        }

        final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(virtualFile);
        if (!filePath.getIOFile().exists() || sandbox.sandboxPjFile == null) {
            return false;
        }
        final FilePath sandboxFolderFilePath =
                VcsContextFactory.SERVICE.getInstance().createFilePathOn(sandbox.sandboxPjFile.getParent());
        final String relativePath = MksVcs.getInstance(project).getRelativePath(filePath, sandboxFolderFilePath);
        if ("".equals(relativePath.trim())) {
            LOGGER.warn("no relative path for " + virtualFile + " from " + sandboxFolderFilePath +
                    ", assuming different sandboxes");
View Full Code Here

        List<VcsException> exceptions = new ArrayList<VcsException>();
        for (Change change : changes) {
            if (FileStatus.MODIFIED.equals(change.getFileStatus())) {
                ContentRevision afterRevision = change.getAfterRevision();
                if (afterRevision != null) {
                    FilePath filePath = afterRevision.getFile();
                    modifiedFiles.add(VcsUtil.getVirtualFile(filePath.getIOFile()));
                }

            } else if (FileStatus.ADDED.equals(change.getFileStatus())) {
                addedFiles.add(change.getAfterRevision().getFile().getVirtualFile());
            }else {
View Full Code Here

     * @throws VcsException if fetching the revision fails
     */
    @Nullable
    private VcsRevisionNumber getCurrentRevision(@NotNull MksSandboxInfo sandbox,
                                                 @NotNull final FilePath filePath) throws VcsException {
        FilePath sandboxPath = VcsUtil.getFilePath(sandbox.sandboxPath);
        FilePath sandboxFolder = sandboxPath.getParentPath();
        assert sandboxFolder != null : "sandbox parent folder can not be null";
        assert filePath.getPath().startsWith(sandboxFolder.getPath()) :
                "" + filePath.getPath() + " should start with " + sandboxFolder.getPath();
        final AbstractViewSandboxCommand command =
                new AbstractViewSandboxCommand(new ArrayList<VcsException>(), vcs, sandbox.sandboxPath
                        , "--filter=file:" + MksVcs.getRelativePath(filePath, sandboxFolder)
//        "--fields=workingrev",
//        "--recurse"
View Full Code Here

          @NotNull final Map<String, MksChangePackage> changePackages,
          final Map<String, MksMemberState> states) {
    final ChangeListManager listManager = ChangeListManager.getInstance(myProject);
    for (Map.Entry<String, MksMemberState> entry : states.entrySet()) {
      MksMemberState state = entry.getValue();
      FilePath filePath = VcsUtil.getFilePath(entry.getKey());
      VirtualFile virtualFile = VcsUtil.getVirtualFile(entry.getKey());
            if (MksMemberState.Status.MISSING  == state.status ) {
                builder.processLocallyDeletedFile(filePath);
                continue;
            }
View Full Code Here

  }

  private void addNonExcludedStates
      (Map<String, MksMemberState> collectingMap, Map<String, MksMemberState> source) {
    for (Map.Entry<String, MksMemberState> entry : source.entrySet()) {
      final FilePath path = VcsUtil.getFilePath(entry.getKey());
      if (path.getVirtualFile() != null && ProjectScope.getProjectScope(myProject).contains(path.getVirtualFile())) {
        collectingMap.put(entry.getKey(), entry.getValue());
      } else if (entry.getValue().status == MksMemberState.Status.MISSING) {
                collectingMap.put(entry.getKey(), entry.getValue());
            } else if (logger.isDebugEnabled()) {
        logger.debug("skipping " + path.getPath());
      }

    }
  }
View Full Code Here

            Messages.showErrorDialog(project, file.getName() + " is not managed by Subversion", ERROR_DIALOG_TITLE);
            return;
        }

        VcsContextFactory vcsContext = VcsContextFactory.SERVICE.getInstance();
        FilePath filePath = vcsContext.createFilePathOn(file);

        SVNRevisionGraph.createAndShow(project, filePath);
    }
View Full Code Here

TOP

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

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.