Examples of VCSAdapter


Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

            if (resource.isHidden())
                sb.append("H ");
            sb.append(resource.getFullPath().toPortableString());
            IProject project = resource.getProject();
            if (project != null) {
                VCSAdapter vcs = VCSAdapter.getAdapter(project);
                if (vcs != null && vcs.isManaged(resource)) {
                    VCSResourceInfo info = vcs.getResourceInfo(resource);
                    if (info.url != null)
                        sb.append(" " + info.url);
                    if (info.revision != null)
                        sb.append("@" + info.revision);
                }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

                continue;

            SharedProject sharedProject = sarosSession
                .getSharedProject(project);

            VCSAdapter vcs = useVersionControl ? VCSAdapter.getAdapter(project)
                : null;
            ProjectDeltaVisitor visitor;
            if (vcs == null) {
                visitor = new ProjectDeltaVisitor(editorManager, sarosSession,
                    sharedProject);
            } else {
                visitor = vcs.getProjectDeltaVisitor(editorManager,
                    sarosSession, sharedProject);
            }
            try {
                projectDelta.accept(visitor, IContainer.INCLUDE_HIDDEN);
            } catch (CoreException e) {
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

     * @return
     */
    protected boolean checkVCSConnection(IProject project) {
        SharedProject sharedProject = sarosSession.getSharedProject(project);

        VCSAdapter vcs = VCSAdapter.getAdapter(project);
        VCSAdapter oldVcs = sharedProject.getVCSAdapter();

        if (sharedProject.updateVcs(vcs)) {
            if (vcs == null) {
                // Disconnect
                boolean deleteContent = oldVcs == null
                    || !oldVcs.hasLocalCache(project);
                VCSActivity activity = VCSActivity.disconnect(sarosSession,
                    project, deleteContent);
                pendingActivities.enter(activity);
                sharedProject.updateRevision(null);
                sharedProject.updateVcsUrl(null);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

        final String directory = activity.getDirectory();
        final String revision = activity.getParam1();

        // Connect is special since the project doesn't have a VCSAdapter
        // yet.
        final VCSAdapter vcs = activityType == VCSActivity.Type.Connect ? VCSAdapter
            .getAdapter(revision) : VCSAdapter.getAdapter(project);
        if (vcs == null) {
            log.warn("Could not execute VCS activity. Do you have the Subclipse plug-in installed?");
            if (activity.containedActivity.size() > 0) {
                log.trace("contained activities: "
                    + activity.containedActivity.toString());
            }
            for (IResourceActivity a : activity.containedActivity) {
                exec(a);
            }
            return;
        }

        try {
            // TODO Should these operations run in an IWorkspaceRunnable?
            Shell shell = EditorAPI.getAWorkbenchWindow().getShell();
            ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(
                shell);
            progressMonitorDialog.open();
            Shell pmdShell = progressMonitorDialog.getShell();
            pmdShell.setText("Saros running VCS operation");
            log.trace("about to call progressMonitorDialog.run");
            progressMonitorDialog.run(true, false, new IRunnableWithProgress() {
                public void run(IProgressMonitor progress)

                throws InvocationTargetException, InterruptedException {
                    log.trace("progressMonitorDialog.run started");
                    if (!Utils.isSWT())
                        log.trace("not in SWT thread");
                    if (activityType == VCSActivity.Type.Connect) {
                        vcs.connect(project, url, directory, progress);
                    } else if (activityType == VCSActivity.Type.Disconnect) {
                        vcs.disconnect(project, revision != null, progress);
                    } else if (activityType == VCSActivity.Type.Switch) {
                        vcs.switch_(resource, url, revision, progress);
                    } else if (activityType == VCSActivity.Type.Update) {
                        vcs.update(resource, revision, progress);
                    } else {
                        log.error("VCS activity type not implemented yet.");
                    }
                    log.trace("progressMonitorDialog.run done");
                }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

        }

        if (!sarosSession.useVersionControl())
            return;

        VCSAdapter vcs = VCSAdapter.getAdapter(project);
        this.vcs.update(vcs);
        if (vcs == null)
            return;
        if (log.isTraceEnabled()) {
            RepositoryProvider provider = RepositoryProvider
                .getProvider(project);
            Subscriber subscriber = provider.getSubscriber();
            if (subscriber != null)
                subscriber.addListener(subscriberChangeListener);
            else
                log.error("Could not add this SharedProject as an ISubscriberChangeListener."); //$NON-NLS-1$
        }
        Set<IPath> paths = resourceMap.keySet();
        for (IPath path : paths) {
            IResource resource = project.findMember(path);
            assert resource != null : "Resource not found at " + path; //$NON-NLS-1$
            VCSResourceInfo info = vcs.getResourceInfo(resource);

            updateVcsUrl(resource, info.url);
            updateRevision(resource, info.revision);
        }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

     * TODO Do unit tests instead
     */
    public boolean checkIntegrity() {
        boolean illegalState = false;
        Set<Entry<IPath, ResourceInfo>> entrySet = resourceMap.entrySet();
        final VCSAdapter vcs = this.vcs.getValue();
        final String projectName = project.getName();
        for (Entry<IPath, ResourceInfo> entry : entrySet) {
            IPath path = entry.getKey();
            IResource resource = project.findMember(path);
            if (resource == null) {
                String msg = format(
                    Messages.SharedProject_resource_in_map_not_exist, path,
                    project.getName());
                logIllegalStateException(msg);
                illegalState = true;
                resourceMap.remove(path);
                continue;
            }
            assert resource.exists();
            if (vcs == null)
                continue;

            VCSResourceInfo expected = vcs.getResourceInfo(resource);
            ResourceInfo found = entry.getValue();
            String foundUrl = found.vcsUrl.getValue();
            String foundRevision = found.vcsRevision.getValue();
            if (found.vcsRevision.update(expected.revision)) {
                String msg = format(
                    Messages.SharedProject_revision_out_of_sync, path,
                    projectName, foundRevision, expected.revision);
                logIllegalStateException(msg);
                illegalState = true;
            }
            if (found.vcsUrl.update(expected.url)) {
                String msg = format(Messages.SharedProject_vcs_url_out_of_sync,
                    path, projectName, foundUrl, expected.url);
                logIllegalStateException(msg);
                illegalState = true;
            }
        }
        IResourceVisitor visitor = new IResourceVisitor() {
            boolean result = false;

            public boolean visit(IResource resource) {
                if (resource == null)
                    return result;
                IPath path = resource.getProjectRelativePath();
                String assMsg = MessageFormat.format(
                    Messages.SharedProject_path_is_null, resource);
                assert path != null : assMsg;
                if (!contains(resource)) {
                    final String msg = format(
                        Messages.SharedProject_resource_map_does_not_contain,
                        projectName, path.toString());
                    logIllegalStateException(msg);
                    result = true;
                    add(resource);
                    if (vcs != null) {
                        final VCSResourceInfo info = vcs
                            .getResourceInfo(resource);
                        updateRevision(resource, info.revision);
                        updateVcsUrl(resource, info.url);
                    }
                }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

                log.error("tried to add a project that wasn't shared");
                // this should never happen
                continue;
            }

            VCSAdapter vcs = null;
            if (preferenceUtils.useVersionControl() && useVersionControl) {
                vcs = VCSAdapter.getAdapter(projectInfo.getFileList()
                    .getVcsProviderID());
            }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.vcs.VCSAdapter

    private void addMembers(List<IResource> resources, SubMonitor subMonitor)
        throws CoreException {
        if (resources.size() == 0)
            return;
        IProject project = null;
        VCSAdapter vcs = null;
        if (useVersionControl) {
            project = resources.get(0).getProject();
            vcs = VCSAdapter.getAdapter(project);
            if (vcs != null) {
                String providerID = vcs.getProviderID(project);

                this.vcsProviderID = providerID;
                this.vcsRepositoryRoot = vcs.getRepositoryString(project);
                this.vcsProjectInfo = vcs.getCurrentResourceInfo(project);
            }
        }

        final boolean isManagedProject = vcs != null;
        for (IResource resource : resources) {
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.