Search in sources :

Example 1 with StateStorageManager

use of com.intellij.configurationStore.StateStorageManager in project intellij-community by JetBrains.

the class CommitToIcsDialog method commitChanges.

private void commitChanges(List<Change> changes) {
    StateStorageManager storageManager = ServiceKt.getStateStore(project).getStateStorageManager();
    TrackingPathMacroSubstitutor macroSubstitutor = storageManager.getMacroSubstitutor();
    assert macroSubstitutor != null;
    IcsManager icsManager = IcsManagerKt.getIcsManager();
    SmartList<String> addToIcs = new SmartList<>();
    for (Change change : changes) {
        VirtualFile file = change.getVirtualFile();
        assert file != null;
        String fileSpec = macroSubstitutor.collapsePath(file.getPath());
        String repoPath = IcsUrlBuilderKt.toRepositoryPath(fileSpec, RoamingType.DEFAULT, projectId);
        addToIcs.add(repoPath);
        if (!icsManager.getRepositoryManager().has(repoPath)) {
        // new, revert local
        // todo
        }
    }
//icsManager.getRepositoryManager().commit(addToIcs);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) StateStorageManager(com.intellij.configurationStore.StateStorageManager) TrackingPathMacroSubstitutor(com.intellij.openapi.components.TrackingPathMacroSubstitutor) Change(com.intellij.openapi.vcs.changes.Change) SmartList(com.intellij.util.SmartList)

Aggregations

StateStorageManager (com.intellij.configurationStore.StateStorageManager)1 TrackingPathMacroSubstitutor (com.intellij.openapi.components.TrackingPathMacroSubstitutor)1 Change (com.intellij.openapi.vcs.changes.Change)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 SmartList (com.intellij.util.SmartList)1