Package org.eclipse.egit.core.synchronize.dto

Examples of org.eclipse.egit.core.synchronize.dto.GitSynchronizeData$RemoteAndMerge


    GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet();
    for (Entry<Repository, Set<IResource>> entry : containerMap.entrySet())
      try {
        Repository repo = entry.getKey();
        String dstRef = getDstRef(repo, launchFetch);
        GitSynchronizeData data = new GitSynchronizeData(repo, HEAD, dstRef, true);
        Set<IResource> containers = entry.getValue();
        if (!containers.isEmpty())
          data.setIncludedResources(containers);

        gsdSet.add(data);
      } catch (IOException e) {
        Activator.handleError(e.getMessage(), e, true);
      }
View Full Code Here


        item.setImage(branchImage);

      item.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
          GitSynchronizeData data;
          try {
            data = new GitSynchronizeData(repo, HEAD, name, true);
            if (!(selectedResource instanceof IProject)) {
              HashSet<IResource> resources = new HashSet<IResource>();
              resources.add(selectedResource);
              data.setIncludedResources(resources);
            }

            GitModelSynchronize.launch(data, new IResource[] { selectedResource });
          } catch (IOException e) {
            Activator.logError(e.getMessage(), e);
View Full Code Here

  @Override
  protected IResourceVariant fetchVariant(IResource resource, int depth,
      IProgressMonitor monitor) throws TeamException {
    if (resource != null) {
      GitSynchronizeData data = gsds.getData(resource.getProject());
      if (data != null && data.shouldIncludeLocal())
        return new GitLocalResourceVariant(resource);
    }

    return super.fetchVariant(resource, depth, monitor);
  }
View Full Code Here

      String dstRef, boolean includeLocal) throws IOException {
    IProject project = ResourcesPlugin.getWorkspace().getRoot()
        .getProject(projectName);
    Repository repo = RepositoryMapping.getMapping(project).getRepository();

    GitSynchronizeData data = new GitSynchronizeData(repo, srcRef, dstRef,
        includeLocal);

    JobJoiner jobJoiner = JobJoiner.startListening(
        ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60,
        TimeUnit.SECONDS);
View Full Code Here

    assertEquals(expectedContents, contentsBuilder.toString());
  }

  private IMergeContext prepareContext(IFile workspaceFile, String srcRev,
      String dstRev) throws Exception {
    GitSynchronizeData gsd = new GitSynchronizeData(repo, srcRev, dstRev,
        true, Collections.<IResource> singleton(workspaceFile));
    GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());
View Full Code Here

      }
    } while (includedResources.addAll(newResources));
    ResourceMapping[] mappings = allMappings
        .toArray(new ResourceMapping[allMappings.size()]);

    GitSynchronizeData gsd = new GitSynchronizeData(repo, srcRev, dstRev,
        true, includedResources);
    GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());
View Full Code Here

    assertEquals(commit, ((GitRemoteResource) variant).getCommitId());
  }

  private GitResourceVariantTreeSubscriber createGitResourceVariantTreeSubscriber(
      String src, String dst, boolean includeLocal) throws IOException {
    GitSynchronizeData gsd = new GitSynchronizeData(
        testRepo.getRepository(), src, dst, includeLocal);
    GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
    return new GitResourceVariantTreeSubscriber(gsds);
  }
View Full Code Here

    try {
      Repository[] repositories = Activator.getDefault()
          .getRepositoryCache().getAllRepositories();
      for (Repository repository : repositories) {
        if (!repository.isBare()) {
          GitSynchronizeData data = new GitSynchronizeData(
              repository, Constants.HEAD, Constants.HEAD, true);
          set.add(data);
        }
      }
    } catch (IOException e) {
View Full Code Here

    Job job = new WorkspaceJob(NLS.bind(UIText.SynchronizeCommand_jobName,
        repo.getDirectory())) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        GitSynchronizeData data;
        try {
          data = new GitSynchronizeData(repo, secondRefNameParam,
              refName, includeLocal);

          Set<IProject> projects = data.getProjects();
          IResource[] resources = projects
              .toArray(new IResource[projects.size()]);

          GitModelSynchronize.launch(data, resources);
        } catch (IOException e) {
View Full Code Here

  public void shouldReturnFalseWhenContentLengthIsDifferent()
      throws Exception {
    // when
    byte[] shortContent = "short content".getBytes("UTF-8");
    byte[] longContent = "very long long content".getBytes("UTF-8");
    GitSynchronizeData data = new GitSynchronizeData(repo, HEAD, HEAD, true);
    GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data);
    GitResourceVariantComparator grvc = new GitResourceVariantComparator(
        dataSet);

    // given
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.synchronize.dto.GitSynchronizeData$RemoteAndMerge

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.