com.intellij.openapi.vcs.update.UpdatedFiles Java Examples

The following examples show how to use com.intellij.openapi.vcs.update.UpdatedFiles. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChangesCacheFile.java    From consulo with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example #2
Source File: ResolveConflictHelper.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
public ResolveConflictHelper(final Project project,
                             final UpdatedFiles updatedFiles,
                             final List<String> updateRoots,
                             final MergeResults mergeResults) {
    this.project = project;
    this.updatedFiles = updatedFiles;
    this.updateRoots = updateRoots;
    this.mergeResults = mergeResults;
}
 
Example #3
Source File: P4IntegrateEnvironment.java    From p4ic4idea with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public UpdateSession updateDirectories(@NotNull FilePath[] filePaths, UpdatedFiles updatedFiles,
        ProgressIndicator progressIndicator, @NotNull Ref<SequentialUpdatesContext> ref)
        throws ProcessCanceledException {
    // FIXME
    throw new IllegalStateException("not implemented");
}
 
Example #4
Source File: P4StatusUpdateEnvironment.java    From p4ic4idea with Apache License 2.0 5 votes vote down vote up
@Override
public void fillGroups(UpdatedFiles updatedFiles) {
    updatedFiles.registerGroup(new FileGroup(
            P4Bundle.message("update.status.offline"),
            P4Bundle.message("update.status.offline"),
            false,
            OFFLINE_GROUP_ID,
            false));
}
 
Example #5
Source File: ProjectLevelVcsManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@CalledInAwt
@Nullable
@Override
public UpdateInfoTree showUpdateProjectInfo(UpdatedFiles updatedFiles, String displayActionName, ActionInfo actionInfo, boolean canceled) {
  if (!myProject.isOpen() || myProject.isDisposed()) return null;
  ContentManager contentManager = getContentManager();
  if (contentManager == null) {
    return null;  // content manager is made null during dispose; flag is set later
  }
  final UpdateInfoTree updateInfoTree = new UpdateInfoTree(contentManager, myProject, updatedFiles, displayActionName, actionInfo);
  ContentUtilEx.addTabbedContent(contentManager, updateInfoTree, "Update Info", DateFormatUtil.formatDateTime(System.currentTimeMillis()), false, updateInfoTree);
  updateInfoTree.expandRootChildren();
  return updateInfoTree;
}
 
Example #6
Source File: CommittedChangesCache.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void processUpdatedFiles(final UpdatedFiles updatedFiles, @Nullable final Consumer<List<CommittedChangeList>> incomingChangesConsumer) {
  final Runnable task = new Runnable() {
    @Override
    public void run() {
      debug("Processing updated files");
      final Collection<ChangesCacheFile> caches = myCachesHolder.getAllCaches();
      myPendingUpdateCount += caches.size();
      for (final ChangesCacheFile cache : caches) {
        try {
          if (cache.isEmpty()) {
            pendingUpdateProcessed(incomingChangesConsumer);
            continue;
          }
          debug("Processing updated files in " + cache.getLocation());
          boolean needRefresh = cache.processUpdatedFiles(updatedFiles, myNewIncomingChanges);
          if (needRefresh) {
            debug("Found unaccounted files, requesting refresh");
            // todo do we need double-queueing here???
            processUpdatedFilesAfterRefresh(cache, updatedFiles, incomingChangesConsumer);
          }
          else {
            debug("Clearing cached incoming changelists");
            myCachedIncomingChangeLists = null;
            pendingUpdateProcessed(incomingChangesConsumer);
          }
        }
        catch (IOException e) {
          LOG.error(e);
        }
      }
    }
  };
  myTaskQueue.run(task);
}
 
Example #7
Source File: RemoteRevisionsCache.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void invalidate(final UpdatedFiles updatedFiles) {
  final Map<String, RemoteDifferenceStrategy> strategyMap;
  synchronized (myLock) {
    strategyMap = new HashMap<>(myKinds);
  }
  final Collection<String> newForTree = new LinkedList<>();
  final Collection<String> newForUsual = new LinkedList<>();
  UpdateFilesHelper.iterateAffectedFiles(updatedFiles, new Consumer<Couple<String>>() {
    public void consume(final Couple<String> pair) {
      final String vcsName = pair.getSecond();
      RemoteDifferenceStrategy strategy = strategyMap.get(vcsName);
      if (strategy == null) {
        final AbstractVcs vcs = myVcsManager.findVcsByName(vcsName);
        if (vcs == null) return;
        strategy = vcs.getRemoteDifferenceStrategy();
      }
      if (RemoteDifferenceStrategy.ASK_TREE_PROVIDER.equals(strategy)) {
        newForTree.add(pair.getFirst());
      } else {
        newForUsual.add(pair.getFirst());
      }
    }
  });

  myRemoteRevisionsStateCache.invalidate(newForTree);
  myRemoteRevisionsNumbersCache.invalidate(newForUsual);
}
 
Example #8
Source File: ResolveConflictHelper.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
public ResolveConflictHelper(final Project project,
                             final UpdatedFiles updatedFiles,
                             final List<String> updateRoots) {
    this(project, updatedFiles, updateRoots, null);
}
 
Example #9
Source File: TFSUpdateEnvironment.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
@Override
public void fillGroups(final UpdatedFiles updatedFiles) {
}
 
Example #10
Source File: P4SyncUpdateEnvironment.java    From p4ic4idea with Apache License 2.0 4 votes vote down vote up
@Override
public void fillGroups(UpdatedFiles updatedFiles) {
    // The plugin doesn't have any non-standard update file groups, so this call does nothing.
}
 
Example #11
Source File: P4IntegrateEnvironment.java    From p4ic4idea with Apache License 2.0 4 votes vote down vote up
@Override
public void fillGroups(UpdatedFiles updatedFiles) {
    // FIXME
    throw new IllegalStateException("not implemented");
}
 
Example #12
Source File: ProjectLevelVcsManagerEx.java    From consulo with Apache License 2.0 4 votes vote down vote up
public abstract UpdateInfoTree showUpdateProjectInfo(UpdatedFiles updatedFiles,
String displayActionName,
ActionInfo actionInfo,
boolean canceled);
 
Example #13
Source File: ProjectLevelVcsManagerImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@CalledInAwt
@Override
public void showProjectOperationInfo(final UpdatedFiles updatedFiles, String displayActionName) {
  UpdateInfoTree tree = showUpdateProjectInfo(updatedFiles, displayActionName, ActionInfo.STATUS, false);
  if (tree != null) ViewUpdateInfoNotification.focusUpdateInfoTree(myProject, tree);
}
 
Example #14
Source File: CommittedChangesCache.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void processUpdatedFiles(final UpdatedFiles updatedFiles) {
  processUpdatedFiles(updatedFiles, null);
}
 
Example #15
Source File: P4StatusUpdateEnvironment.java    From p4ic4idea with Apache License 2.0 3 votes vote down vote up
/**
 * Performs the update/integrate/status operation.
 *
 * @param contentRoots      the content roots for which update/integrate/status was requested by the user.
 * @param updatedFiles      the holder for the results of the update/integrate/status operation.
 * @param progressIndicator the indicator that can be used to report the progress of the operation.
 * @param context           in-out parameter: a link between several sequential update operations (that can be triggered by one update action)
 * @return the update session instance, which can be used to get information about errors that have occurred
 * during the operation and to perform additional post-update processing.
 * @throws ProcessCanceledException if the update operation has been cancelled by the user. Alternatively,
 *                                  cancellation can be reported by returning true from
 *                                  {@link UpdateSession#isCanceled}.
 */
@NotNull
@Override
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, UpdatedFiles updatedFiles,
        ProgressIndicator progressIndicator, @NotNull Ref<SequentialUpdatesContext> context)
        throws ProcessCanceledException {
    throw new IllegalStateException("not implemented");
}
 
Example #16
Source File: ProjectLevelVcsManager.java    From consulo with Apache License 2.0 votes vote down vote up
public abstract void showProjectOperationInfo(final UpdatedFiles updatedFiles, String displayActionName);