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

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


      String dstRev = child.getString(DST_REV_KEY);
      boolean includeLocal = getBoolean(
          child.getBoolean(INCLUDE_LOCAL_KEY), true);
      Set<IResource> includedResources = getIncludedResources(child);
      try {
        GitSynchronizeData data = new GitSynchronizeData(repo, srcRev,
            dstRev, includeLocal);
        if (includedResources != null)
          data.setIncludedResources(includedResources);
        gsds.add(data);
      } catch (IOException e) {
        Activator.logError(e.getMessage(), e);
        continue;
      }
View Full Code Here


    } else if (srcRev.equals(GitFileRevision.INDEX)) {
      // Even git tree compare cannot handle index as source...
      // Synchronize using the local data for now.
      final ResourceMapping[] mappings = allMappings
          .toArray(new ResourceMapping[allMappings.size()]);
      final GitSynchronizeData data = new GitSynchronizeData(repository,
          srcRev, dstRev, true, includedResources);
      launch(new GitSynchronizeDataSet(data), mappings);
    } else {
      final ResourceMapping[] mappings = allMappings
          .toArray(new ResourceMapping[allMappings.size()]);
      final GitSynchronizeData data = new GitSynchronizeData(repository,
          srcRev, dstRev, includeLocal, includedResources);
      launch(new GitSynchronizeDataSet(data), mappings);
    }
  }
View Full Code Here

      ResourceMappingContext context, IProgressMonitor monitor)
      throws CoreException {
    if (context instanceof GitSubscriberResourceMappingContext) {
      GitSubscriberResourceMappingContext gitContext = (GitSubscriberResourceMappingContext) context;
      GitSynchronizeDataSet gsds = gitContext.getSyncData();
      GitSynchronizeData data = gsds.getData(resource.getProject());

      if (data != null) {
        GitModelObject object = null;
        try {
          object = GitModelObject.createRoot(data);
View Full Code Here

    Map<Repository, String> branches = page.getSelectedBranches();
    boolean shouldIncludeLocal = page.shouldIncludeLocal();
    for (Entry<Repository, String> branchesEntry : branches.entrySet())
      try {
        Repository repo = branchesEntry.getKey();
        GitSynchronizeData data = new GitSynchronizeData(
            repo, HEAD, branchesEntry.getValue(),
            shouldIncludeLocal);
        Set<IResource> resources = getSelectedResources(repo);
        if (resources != null && resources.size() > 0)
          data.setIncludedResources(resources);
        gsdSet.add(data);
      } catch (IOException e) {
        Activator.logError(e.getMessage(), e);
      }
View Full Code Here

  @Override
  public IResource[] members(IResource res) throws TeamException {
    if (res.getType() == IResource.FILE || !gsds.shouldBeIncluded(res))
      return new IResource[0];

    GitSynchronizeData gsd = gsds.getData(res.getProject());
    Repository repo = gsd.getRepository();
    GitSyncObjectCache repoCache = cache.get(repo);

    Set<IResource> gitMembers = new HashSet<IResource>();
    Map<String, IResource> allMembers = new HashMap<String, IResource>();
View Full Code Here

    // not refreshing the workspace, locate and collect target resources
    Map<GitSynchronizeData, Collection<String>> updateRequests = new HashMap<GitSynchronizeData, Collection<String>>();
    for (IResource resource : resources) {
      IProject project = resource.getProject();
      GitSynchronizeData data = gsds.getData(project.getName());
      if (data != null) {
        RepositoryMapping mapping = RepositoryMapping
            .getMapping(project);
        // mapping may be null if the project has been closed
        if (mapping != null) {
View Full Code Here

    gsds.dispose();
  }

  @Override
  public IDiff getDiff(IResource resource) throws CoreException {
    final GitSynchronizeData syncData = gsds.getData(resource.getProject());
    if (syncData == null || syncData.shouldIncludeLocal())
      return super.getDiff(resource);

    SyncInfo info = getSyncInfo(resource);
    if (info == null || info.getKind() == SyncInfo.IN_SYNC)
      return null;
View Full Code Here

     *            The local file.
     * @return The file revision that should be considered for the local
     *         (left) side a delta
     */
    protected IFileRevision getLocalFileRevision(IFile local) {
      final GitSynchronizeData data = gsds.getData(local.getProject());
      if (data.shouldIncludeLocal())
        return new WorkspaceFileRevision(local);

      try {
        return asFileState(getSourceTree().getResourceVariant(local));
      } catch (TeamException e) {
View Full Code Here

    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)
View Full Code Here

  private GitModelObject[] getChildrenImpl() {
    List<GitModelObject> result = new ArrayList<GitModelObject>();
    try {
      if (gsds.size() == 1) {
        GitSynchronizeData gsd = gsds.iterator().next();
        GitModelRepository repoModel = new GitModelRepository(gsd);

        return repoModel.getChildren();
      } else
        for (GitSynchronizeData data : gsds) {
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.