Search in sources :

Example 1 with GitLazyResourceVariantTreeSubscriber

use of org.eclipse.egit.core.synchronize.GitLazyResourceVariantTreeSubscriber in project egit by eclipse.

the class ModelAwareGitSynchronizer method createResourceMappingContext.

/**
 * @param resources
 * @param repository
 * @param leftRev
 * @param rightRev
 * @param includeLocal
 * @param monitor
 * @return A resource mapping context to access the versions of the content
 *         of the resources involved in the synchronization.
 */
protected ResourceMappingContext createResourceMappingContext(Set<IResource> resources, Repository repository, String leftRev, String rightRev, boolean includeLocal, IProgressMonitor monitor) {
    try {
        GitSynchronizeData gsd = new GitSynchronizeData(repository, leftRev, rightRev, includeLocal, resources);
        GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
        GitLazyResourceVariantTreeSubscriber subscriber = new GitLazyResourceVariantTreeSubscriber(gsds);
        subscriber.init(monitor);
        return new GitSubscriberResourceMappingContext(subscriber, gsds);
    } catch (IOException e) {
        Activator.logError(e.getMessage(), e);
    }
    return ResourceMappingContext.LOCAL_CONTEXT;
}
Also used : GitSynchronizeData(org.eclipse.egit.core.synchronize.dto.GitSynchronizeData) GitSynchronizeDataSet(org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet) GitSubscriberResourceMappingContext(org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext) GitLazyResourceVariantTreeSubscriber(org.eclipse.egit.core.synchronize.GitLazyResourceVariantTreeSubscriber) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 GitLazyResourceVariantTreeSubscriber (org.eclipse.egit.core.synchronize.GitLazyResourceVariantTreeSubscriber)1 GitSubscriberResourceMappingContext (org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext)1 GitSynchronizeData (org.eclipse.egit.core.synchronize.dto.GitSynchronizeData)1 GitSynchronizeDataSet (org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet)1