use of com.intellij.openapi.vcs.RepositoryLocation in project intellij-community by JetBrains.
the class SvnCommittedListsZipper method groupLocations.
public Pair<List<RepositoryLocationGroup>, List<RepositoryLocation>> groupLocations(final List<RepositoryLocation> in) {
final List<RepositoryLocationGroup> groups = new ArrayList<>();
final List<RepositoryLocation> singles = new ArrayList<>();
final MultiMap<SVNURL, RepositoryLocation> map = new MultiMap<>();
for (RepositoryLocation location : in) {
final SvnRepositoryLocation svnLocation = (SvnRepositoryLocation) location;
final String url = svnLocation.getURL();
final SVNURL root = SvnUtil.getRepositoryRoot(myVcs, url);
if (root == null) {
// should not occur
LOG.info("repository root not found for location:" + location.toPresentableString());
singles.add(location);
} else {
map.putValue(root, svnLocation);
}
}
final Set<SVNURL> keys = map.keySet();
for (SVNURL key : keys) {
final Collection<RepositoryLocation> repositoryLocations = map.get(key);
if (repositoryLocations.size() == 1) {
singles.add(repositoryLocations.iterator().next());
} else {
final SvnRepositoryLocationGroup group = new SvnRepositoryLocationGroup(key, repositoryLocations);
groups.add(group);
}
}
return Pair.create(groups, singles);
}
use of com.intellij.openapi.vcs.RepositoryLocation in project intellij-community by JetBrains.
the class VcsCommittedListsZipperAdapter method groupLocations.
public Pair<List<RepositoryLocationGroup>, List<RepositoryLocation>> groupLocations(final List<RepositoryLocation> in) {
final List<RepositoryLocationGroup> groups = new ArrayList<>();
final List<RepositoryLocation> singles = new ArrayList<>();
final MultiMap<Object, RepositoryLocation> map = new MultiMap<>();
for (RepositoryLocation location : in) {
final Object key = myGroupCreator.createKey(location);
map.putValue(key, location);
}
final Set<Object> keys = map.keySet();
for (Object key : keys) {
final Collection<RepositoryLocation> locations = map.get(key);
if (locations.size() == 1) {
singles.addAll(locations);
} else {
final RepositoryLocationGroup group = myGroupCreator.createGroup(key, locations);
groups.add(group);
}
}
return Pair.create(groups, singles);
}
use of com.intellij.openapi.vcs.RepositoryLocation in project intellij-community by JetBrains.
the class ClearCommittedAction method update.
public void update(final AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project != null) {
CommittedChangesPanel panel = ChangesViewContentManager.getInstance(project).getActiveComponent(CommittedChangesPanel.class);
RepositoryLocation rl = panel == null ? null : panel.getRepositoryLocation();
e.getPresentation().setVisible(rl == null);
e.getPresentation().setEnabled(panel != null && (!panel.isInLoad()));
} else {
e.getPresentation().setVisible(false);
e.getPresentation().setEnabled(false);
}
}
Aggregations