Package org.eclipse.team.core.history

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


      final Subscriber subscriber = ((SubscriberMergeContext)ctx).getSubscriber();

      if (resource instanceof IFile
          && subscriber instanceof GitResourceVariantTreeSubscriber) {
        try {
          final IFileRevision revision = ((GitResourceVariantTreeSubscriber) subscriber)
              .getSourceFileRevision((IFile) resource);
          if (revision == null) {
            final ITypedElement newSource = new GitCompareFileRevisionEditorInput.EmptyTypedElement(
                resource.getName());
            ((ResourceDiffCompareInput) input).setLeft(newSource);
View Full Code Here


  }

  private void blameParent(RevCommit parent, Diff diff, Integer sourceLine) {
    try {
      String path = diff.getOldPath();
      IFileRevision rev = CompareUtils.getFileRevision(path, parent,
          revision.getRepository(), null);
      int line = sourceLine == null ? -1 : sourceLine.intValue();
      IStorage storage = rev.getStorage(new NullProgressMonitor());
      IWorkbenchPage page = PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage();
      BlameOperation operation = new BlameOperation(
          revision.getRepository(), storage, path, parent,
          getShell(), page, line);
View Full Code Here

        // can this really happen?
        if (right instanceof EmptyTypedElement)
          continue;

        IFileRevision rev;
        // if the file is not conflicting (as it was auto-merged)
        // we will show the auto-merged (local) version

        Path repositoryPath = new Path(repository.getWorkTree()
            .getAbsolutePath());
View Full Code Here

        AbstractTreeIterator compareVersionIterator = tw.getTree(
            compareTreeIndex, AbstractTreeIterator.class);
        AbstractTreeIterator baseVersionIterator = tw.getTree(
            baseTreeIndex, AbstractTreeIterator.class);

        IFileRevision left = null;
        IFileRevision right = null;
        String repoRelativePath = baseVersionIterator != null
            ? baseVersionIterator.getEntryPathString()
            : compareVersionIterator.getEntryPathString();
        IPath currentPath = new Path(repoRelativePath);
View Full Code Here

   * @param monitor
   * @throws CoreException
   */
  public void fetchAuthor(IProgressMonitor monitor) throws CoreException {
    if (getAuthor() == null && fileRevision.isPropertyMissing()) {
      IFileRevision other = fileRevision.withAllProperties(monitor);
      author = other.getAuthor();
    }
  }
View Full Code Here

  public ImageDescriptor getImageDescriptor() {
    return null;
  }

  public String getName() {
    IFileRevision rev = (IFileRevision) getAdapter(IFileRevision.class);
    if (rev != null)
      return NLS.bind(
          UIText.FileRevisionEditorInput_NameAndRevisionTitle,
          new String[] { rev.getName(), rev.getContentIdentifier() });
    IFileState state = (IFileState) getAdapter(IFileState.class);
    if (state != null)
      return state.getName()
          + " " + DateFormat.getInstance().format(new Date(state.getModificationTime())); //$NON-NLS-1$
    return storage.getName();
View Full Code Here

  public ImageDescriptor getImageDescriptor(Object object) {
    return null;
  }

  public String getLabel(Object o) {
    IFileRevision rev = (IFileRevision) getAdapter(IFileRevision.class);
    if (rev != null)
      return rev.getName();
    return storage.getName();
  }
View Full Code Here

  /**
   * @return the revision
   */
  public URI getURI() {
    if (fileRevision instanceof IFileRevision) {
      IFileRevision fr = (IFileRevision) fileRevision;
      return fr.getURI();
    }
    return null;
  }
View Full Code Here

            kind = IDiff.ADD;
          else
            kind = IDiff.CHANGE;

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

          kind = IDiff.REMOVE;
        else
          kind = IDiff.CHANGE;

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

TOP

Related Classes of org.eclipse.team.core.history.IFileRevision

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.