Examples of IFileRevision


Examples of org.eclipse.team.core.history.IFileRevision

        else
          kind = IDiff.CHANGE;

        // For folders, we don't need file states
        if (info.getLocal().getType() == IResource.FILE) {
          IFileRevision before = asFileState(ancestor);
          IFileRevision after = asFileState(remote);
          return new ResourceDiff(info.getLocal(), kind, 0, before,
              after);
        }

        return new ResourceDiff(info.getLocal(), kind);
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

  private void registerOpenWorkspaceVersion(MenuManager menu,
      final ISelectionProvider selectionProvider) {
    FileRevisionTypedElement leftRevision = getLeftRevision();
    if (leftRevision != null) {
      IFileRevision fileRevision = leftRevision.getFileRevision();
      if (fileRevision instanceof OpenWorkspaceVersionEnabled) {
        OpenWorkspaceVersionEnabled workspaceVersion = (OpenWorkspaceVersionEnabled) fileRevision;
        final File workspaceFile = new File(workspaceVersion
            .getRepository().getWorkTree(),
            workspaceVersion.getGitPath());
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

    ITypedElement right = new GitCompareFileRevisionEditorInput.EmptyTypedElement(
        NLS.bind(UIText.GitHistoryPage_FileNotInCommit,
            getName(gitPath), truncatedRevision(commit.name())));

    try {
      IFileRevision nextFile = getFileRevision(gitPath, commit, db,
              blobId);
        if (nextFile != null) {
          String encoding = CompareCoreUtils.getResourceEncoding(db, gitPath);
          right = new FileRevisionTypedElement(nextFile, encoding);
        }
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

      throws IOException {

    TreeWalk w = TreeWalk.forPath(db, gitPath, commit.getTree());
    // check if file is contained in commit
    if (w != null) {
      final IFileRevision fileRevision = GitFileRevision.inCommit(db,
          commit, gitPath, blobId);
      return fileRevision;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

        file);
    ITypedElement base = getHeadTypedElement(repository, path);
    if (base == null)
      return;

    IFileRevision nextFile = new WorkspaceFileRevision(file);
    String encoding = null;
    try {
      encoding = file.getCharset();
    } catch (CoreException e) {
      Activator.handleError(UIText.CompareUtils_errorGettingEncoding, e, true);
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

  public static void compareHeadWithWorkingTree(Repository repository,
      String path) {
    ITypedElement base = getHeadTypedElement(repository, path);
    if (base == null)
      return;
    IFileRevision nextFile;
    nextFile = new WorkingTreeFileRevision(new File(
        repository.getWorkTree(), path));
    String encoding = ResourcesPlugin.getEncoding();
    ITypedElement next = new FileRevisionTypedElement(nextFile, encoding);
    GitCompareFileRevisionEditorInput input = new GitCompareFileRevisionEditorInput(
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

    return getIndexTypedElement(repository, repoRelativePath, encoding);
  }

  private static ITypedElement getIndexTypedElement(
      final Repository repository, final String gitPath, String encoding) {
    IFileRevision nextFile = GitFileRevision.inIndex(repository, gitPath);
    final EditableRevision next = new EditableRevision(nextFile, encoding);

    IContentChangeListener listener = new IContentChangeListener() {
      public void contentChanged(IContentChangeNotifier source) {
        final byte[] newContent = next.getModifiedContent();
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

    openInEditor(d.getOldPath(), commit, blob);
  }

  private void openInEditor(String path, RevCommit commit, ObjectId blob) {
    try {
      IFileRevision rev = CompareUtils.getFileRevision(path, commit,
          getRepository(), blob);
      if (rev != null) {
        IWorkbenchWindow window = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow();
        IWorkbenchPage page = window.getActivePage();
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

          .getActiveWorkbenchWindow();
      IWorkbenchPage page = window.getActivePage();
      RevCommit commit = d.getChange().equals(ChangeType.DELETE) ? d
          .getCommit().getParent(0) : d.getCommit();
      String path = d.getPath();
      IFileRevision rev = CompareUtils.getFileRevision(path, commit,
          getRepository(),
          d.getChange().equals(ChangeType.DELETE) ? d.getBlobs()[0]
              : d.getBlobs()[d.getBlobs().length - 1]);
      if (rev != null) {
        BlameOperation op = new BlameOperation(getRepository(),
            rev.getStorage(new NullProgressMonitor()), path,
            commit, window.getShell(), page);
        JobUtil.scheduleUserJob(op, UIText.ShowBlameHandler_JobName,
            JobFamilies.BLAME);
      } else {
        String message = NLS.bind(
View Full Code Here

Examples of org.eclipse.team.core.history.IFileRevision

      IResource resource = ResourceUtil.getResource(editorInput);
      if (resource != null)
        return new StructuredSelection(resource);
      if (editorInput instanceof FileRevisionEditorInput) {
        FileRevisionEditorInput fileRevisionEditorInput = (FileRevisionEditorInput) editorInput;
        IFileRevision fileRevision = fileRevisionEditorInput
            .getFileRevision();
        if (fileRevision != null)
          return new StructuredSelection(fileRevision);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.