Search in sources :

Example 1 with VcsEP

use of com.intellij.openapi.vcs.impl.VcsEP in project intellij-community by JetBrains.

the class AllVcses method getAll.

public VcsDescriptor[] getAll() {
    final List<VcsDescriptor> result = new ArrayList<>(myExtensions.size());
    for (VcsEP vcsEP : myExtensions.values()) {
        result.add(vcsEP.createDescriptor());
    }
    Collections.sort(result);
    return result.toArray(new VcsDescriptor[result.size()]);
}
Also used : VcsEP(com.intellij.openapi.vcs.impl.VcsEP) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor)

Example 2 with VcsEP

use of com.intellij.openapi.vcs.impl.VcsEP in project intellij-community by JetBrains.

the class AllVcses method getByName.

public AbstractVcs getByName(final String name) {
    synchronized (myLock) {
        final AbstractVcs vcs = myVcses.get(name);
        if (vcs != null) {
            return vcs;
        }
    }
    // unmodifiable map => no sync needed
    final VcsEP ep = myExtensions.get(name);
    if (ep == null) {
        return null;
    }
    // VcsEP guarantees to always return the same vcs value
    final AbstractVcs vcs1 = ep.getVcs(myProject);
    LOG.assertTrue(vcs1 != null, name);
    synchronized (myLock) {
        if (!myVcses.containsKey(name)) {
            addVcs(vcs1);
        }
        return vcs1;
    }
}
Also used : VcsEP(com.intellij.openapi.vcs.impl.VcsEP) AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Aggregations

VcsEP (com.intellij.openapi.vcs.impl.VcsEP)2 AbstractVcs (com.intellij.openapi.vcs.AbstractVcs)1 VcsDescriptor (com.intellij.openapi.vcs.impl.VcsDescriptor)1