Examples of IResourceVariant


Examples of org.eclipse.team.core.variants.IResourceVariant

  public SyncInfo getSyncInfo(IResource resource) throws TeamException {
      synchronized (_refreshLock) {           
        try {
            if (isPluginResource(resource)) {
                IResourceVariant variant = null;
                PluginInfo remotePluginInfo = _remotePluginInfos.get(resource);
                if (remotePluginInfo != null) {
                    variant = new WGAPluginResourceVariant(_server, remotePluginInfo);
                }
               
                PluginInfo localPluginInfo = _localPluginInfos.get(resource);
               
                SyncInfo info = new WGAPluginResourceSyncInfo(_runtime, _server, resource, localPluginInfo, variant, _remoteWGAVersion);
                info.init();
                return info;
            } else {
              IResourceVariant variant = null;
              FSDesignResourceState state = _remoteStatesByResource.get(resource);
              if (state != null) {
                variant = new WGAFSDesignResourceVariant(_server, state);
              }
              LocalFSDesignResourceState localState = _localStatesByResource.get(resource);
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

            String repositoryBasePath = fCVSProjectFolder.getRepositoryRelativePath();
            String remotePath = repositoryBasePath + "/" + fullPath;

            ICVSRemoteFile rfile =
                    fCVSRepositoryLocation.getRemoteFile(remotePath, new CVSTag(revision.getNumber(), CVSTag.VERSION));
            IResourceVariant variant = (IResourceVariant) rfile;
            IStorage storage = variant.getStorage(monitor);
            InputStream inputStream = storage.getContents();

            return inputStream;
        } catch (CVSServerException e) {
            // Do not print stack trace
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

        ITwoWayDiff local = getLocalDelta(info);
        ITwoWayDiff remote = getRemoteDelta(info);
        return new ThreeWayDiff(local, remote);
      } else {
        if (info.getKind() != SyncInfo.IN_SYNC) {
          IResourceVariant remote = info.getRemote();
          IResource local = info.getLocal();

          int kind;
          if (remote == null)
            kind = IDiff.REMOVE;
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

    private ITwoWayDiff getLocalDelta(SyncInfo info) {
      int direction = SyncInfo.getDirection(info.getKind());
      if (direction == SyncInfo.OUTGOING
          || direction == SyncInfo.CONFLICTING) {
        IResourceVariant ancestor = info.getBase();
        IResource local = info.getLocal();

        int kind;
        if (ancestor == null)
          kind = IDiff.ADD;
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

     */
    private ITwoWayDiff getRemoteDelta(SyncInfo info) {
      int direction = SyncInfo.getDirection(info.getKind());
      if (direction == SyncInfo.INCOMING
          || direction == SyncInfo.CONFLICTING) {
        IResourceVariant ancestor = info.getBase();
        IResourceVariant remote = info.getRemote();

        int kind;
        if (ancestor == null)
          kind = IDiff.ADD;
        else if (remote == null)
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

  private IResourceVariant fetchVariant(IResource resource) {
    if (gitCache == null)
      return null;

    IResourceVariant cachedVariant = cache.get(resource);
    if (cachedVariant != null)
      return cachedVariant;

    GitSynchronizeData gsd = gsds.getData(resource.getProject());
    if (gsd == null)
      return null;

    Repository repo = gsd.getRepository();
    String path = getPath(resource, repo);

    GitSyncObjectCache syncCache = gitCache.get(repo);
    GitSyncObjectCache cachedData = syncCache.get(path);
    if (cachedData == null)
      return null;

    IResourceVariant variant = null;
    ObjectId objectId = getObjectId(cachedData.getDiffEntry());
    if (!objectId.equals(zeroId())) {
      if (resource.getType() == IResource.FILE)
        variant = new GitRemoteFile(repo, getCommitId(gsd), objectId,
            path);
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

        null);

    // given
    IResource local = mock(IResource.class);
    when(local.exists()).thenReturn(false);
    IResourceVariant remote = new GitRemoteFolder(repo, null, null, null, "./");

    // then
    assertFalse(grvc.compare(local, remote));
  }
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

    // given
    IFile local = mock(IFile.class);
    when(local.exists()).thenReturn(true);

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(true);

    // then
    assertFalse(grvc.compare(local, remote));
  }
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(shortContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
        storage);

    // then
    assertFalse(grvc.compare(local, remote));
  }
View Full Code Here

Examples of org.eclipse.team.core.variants.IResourceVariant

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
        storage);

    // then
    assertFalse(grvc.compare(local, remote));
  }
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.