Package com.intellij.openapi.vcs

Examples of com.intellij.openapi.vcs.FilePath


    }

    @Override
    public void update(@NotNull AnActionEvent e) {
        List<Revision> selection = e.getData(SVNRevisionGraph.SELECTED_REVISIONS);
        FilePath filePath = e.getData(SVNRevisionGraph.SRC_FILE);
        int selectionSize = (selection == null) ? 0 : selection.size();
        Presentation p = e.getPresentation();
        if (selectionSize == 1) {
            p.setText("Compare with local");
            p.setDescription("Compare with local version");
        } else {
            p.setText("Compare");
            p.setDescription("Compare revisions");
        }
        boolean enabled = filePath != null && !filePath.isDirectory()
                && ((selectionSize == 1 && !selection.get(0).isDeleted())
                    || (selectionSize == 2 && !selection.get(0).isDeleted() && !selection.get(1).isDeleted()));
        p.setEnabled(enabled);
        if (ActionPlaces.isPopupPlace(e.getPlace())) {
            p.setVisible(enabled);
View Full Code Here


    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
        final Project project = e.getData(PlatformDataKeys.PROJECT);
        SvnVcs svn = SvnVcs.getInstance(project);
        FilePath filePath = e.getData(SVNRevisionGraph.SRC_FILE);
        if (filePath == null) {
            return;
        }
        List<Revision> revisions = e.getData(SVNRevisionGraph.SELECTED_REVISIONS);
        int selectionSize = (revisions == null) ? 0 : revisions.size();
        final Revision[] revs = new Revision[2];
        if (selectionSize == 2) {
            revs[0] = revisions.get(0);
            revs[1] = revisions.get(1);
        } else if (selectionSize == 1) {
            revs[0] = revisions.get(0);
            revs[1] = e.getData(SVNRevisionGraph.CURRENT_REVISION);
        } else {
            return;
        }
        Arrays.sort(revs, new Revision.RevisionNumberComparator());
        final FileHistoryRetriever historyRetriever = new FileHistoryRetriever(svn, filePath.getVirtualFile());
        new Task.Modal(project, "Loading properties from repository", false) {
            DiffRequest diffRequest;

            @Override
            public void run(@NotNull ProgressIndicator indicator) {
View Full Code Here

        super("Get", "Get version from repository", IconLoader.getIcon("/actions/get.png"));
    }

    public void update(@NotNull AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        FilePath filePath = e.getData(SVNRevisionGraph.SRC_FILE);
        Revision revision = e.getData(SVNRevisionGraph.SELECTED_REVISION);
        boolean enabled = isEnabled(filePath, revision);
        presentation.setEnabled(enabled);
        presentation.setVisible(enabled || !ActionPlaces.isPopupPlace(e.getPlace()));
    }
View Full Code Here

    }

    @Override
    public void actionPerformed(@NotNull AnActionEvent ae) {
        Revision rev = ae.getData(SVNRevisionGraph.SELECTED_REVISION);
        FilePath filePath = ae.getData(SVNRevisionGraph.SRC_FILE);
        Project project = ae.getData(PlatformDataKeys.PROJECT);
        VcsFileRevision revision = ae.getData(VcsDataKeys.VCS_FILE_REVISION);
        if (!isEnabled(filePath, rev)) {
            return;
        }

        if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) {
            return;
        }
        //noinspection ConstantConditions
        if (filePath.getVirtualFile() != null) {
            if (!new ReplaceFileConfirmationDialog(project, "Get revision")
                    .confirmFor(new VirtualFile[]{filePath.getVirtualFile()})) {
                return;
            }
        }
        getVersion(project, filePath, revision);
        refreshFile(project, filePath, revision);
View Full Code Here

                                            @Nullable final ScanMode scanMode,
                                            final boolean collapseRevisions,
                                            final boolean displayOnlyImpactingRevisions) {
        graph.refreshInProgress = true;
        final Project project = graph._project;
        final FilePath filePath = graph._filePath;
        new Task.Backgroundable(project, "Revision History", true, PerformInBackgroundOption.DEAF){
            private FileRevisionHistory history;
            private RevisionGraphModel graphModel;
            private Exception myException;

            @Override
            public void run(@NotNull ProgressIndicator indicator) {
                try {
                    SvnVcs svn = SvnVcs.getInstance(project);
                    if (scanMode != null) {
                        indicator.setText("Collecting revision history for file: " + filePath.getName());
                        history = new FileHistoryRetriever(svn, filePath.getVirtualFile())
                                .getFileHistory(scanMode, indicator);
                    } else {
                        history = graph.revisionHistory;
                    }
                    indicator.setText("Creating graph");
View Full Code Here

    @Override
    public void update(@NotNull AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        Revision revision = e.getData(SVNRevisionGraph.SELECTED_REVISION);
        FilePath filePath = e.getData(SVNRevisionGraph.SRC_FILE);
        boolean enabled = filePath!= null && revision != null && !revision.isDeleted();
        presentation.setEnabled(enabled);
        presentation.setVisible(enabled || !ActionPlaces.isPopupPlace(e.getPlace()));
    }
View Full Code Here

    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {
        final Project project = event.getData(PlatformDataKeys.PROJECT);
        SvnVcs svn = SvnVcs.getInstance(project);
        final Revision revision = event.getData(SVNRevisionGraph.SELECTED_REVISION);
        FilePath filePath = event.getData(SVNRevisionGraph.SRC_FILE);
        if (filePath == null || revision == null) {
            return;
        }
        final FileHistoryRetriever historyRetriever = new FileHistoryRetriever(svn, filePath.getVirtualFile());
        new Task.Modal(project, "Loading properties for " + revision, false) {
            SVNProperties result;

            @Override
            public void run(@NotNull ProgressIndicator indicator) {
View Full Code Here

    public void diffRequestChange(DiffRequest diffRequest, DiffPanelImpl diffPanel) {
        handleComments(diffPanel, diffRequest.getWindowTitle());
    }

    private void handleComments(final DiffPanelImpl diffPanel, final String filePathString) {
        final FilePath filePath = new FilePathImpl(new File(filePathString), false);
        final String relativeFilePath = PathUtils.ensureSlashSeparators(getRelativeOrAbsolutePath(project, filePath.getPath()));

        addCommentAction(diffPanel, relativeFilePath, changeInfo);

        gerritUtil.getChangeDetails(changeInfo._number, project, new Consumer<ChangeInfo>() {
            @Override
View Full Code Here

    return ioFiles;
  }

  public static boolean hasFileChanges(final Collection<Change> changes) {
    for(Change change: changes) {
      FilePath path = ChangesUtil.getFilePath(change);
      if (!path.isDirectory()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    final ContentRevision br1 = getBeforeRevision();
    final ContentRevision br2 = otherChange.getBeforeRevision();
    final ContentRevision ar1 = getAfterRevision();
    final ContentRevision ar2 = otherChange.getAfterRevision();

    FilePath fbr1 = br1 != null ? br1.getFile() : null;
    FilePath fbr2 = br2 != null ? br2.getFile() : null;

    FilePath far1 = ar1 != null ? ar1.getFile() : null;
    FilePath far2 = ar2 != null ? ar2.getFile() : null;

    return Comparing.equal(fbr1, fbr2) && Comparing.equal(far1, far2);
  }
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.