use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.
the class ChangesCacheFile method processUpdatedFiles.
public boolean processUpdatedFiles(UpdatedFiles updatedFiles, Collection<CommittedChangeList> receivedChanges) throws IOException {
boolean haveUnaccountedUpdatedFiles = false;
openStreams();
loadHeader();
ReceivedChangeListTracker tracker = new ReceivedChangeListTracker();
try {
final List<IncomingChangeListData> incomingData = loadIncomingChangeListData();
for (FileGroup group : updatedFiles.getTopLevelGroups()) {
haveUnaccountedUpdatedFiles |= processGroup(group, incomingData, tracker);
}
if (!haveUnaccountedUpdatedFiles) {
for (IncomingChangeListData data : incomingData) {
saveIncoming(data, false);
}
writeHeader();
}
} finally {
closeStreams();
}
receivedChanges.addAll(tracker.getChangeLists());
return haveUnaccountedUpdatedFiles;
}
use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.
the class ChangesCacheFile method processGroup.
private boolean processGroup(final FileGroup group, final List<IncomingChangeListData> incomingData, final ReceivedChangeListTracker tracker) {
boolean haveUnaccountedUpdatedFiles = false;
final List<Pair<String, VcsRevisionNumber>> list = group.getFilesAndRevisions(myVcsManager);
for (Pair<String, VcsRevisionNumber> pair : list) {
final String file = pair.first;
FilePath path = VcsUtil.getFilePath(file, false);
if (!path.isUnder(myRootPath, false) || pair.second == null) {
continue;
}
if (group.getId().equals(FileGroup.REMOVED_FROM_REPOSITORY_ID)) {
haveUnaccountedUpdatedFiles |= processDeletedFile(path, incomingData, tracker);
} else {
haveUnaccountedUpdatedFiles |= processFile(path, pair.second, incomingData, tracker);
}
}
for (FileGroup childGroup : group.getChildren()) {
haveUnaccountedUpdatedFiles |= processGroup(childGroup, incomingData, tracker);
}
return haveUnaccountedUpdatedFiles;
}
use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.
the class UpdateEventHandler method addFileToGroup.
protected void addFileToGroup(final String id, final ProgressEvent event) {
final FileGroup fileGroup = myUpdatedFiles.getGroupById(id);
final String path = event.getFile().getAbsolutePath();
myFilesWaitingForRevision.peek().add(Pair.create(id, path));
if (event.getErrorMessage() != null) {
fileGroup.addError(path, event.getErrorMessage().getMessage());
}
}
use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.
the class MergeChangeCollector method addAll.
/**
* Add all paths to the group
*/
private static void addAll(final UpdatedFiles updates, String group_id, Set<String> paths) {
FileGroup fileGroup = updates.getGroupById(group_id);
final VcsKey vcsKey = GitVcs.getKey();
for (String path : paths) {
fileGroup.add(path, vcsKey, null);
}
}
Aggregations