• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java VcsDirtyScope类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.intellij.openapi.vcs.changes.VcsDirtyScope的典型用法代码示例。如果您正苦于以下问题:Java VcsDirtyScope类的具体用法?Java VcsDirtyScope怎么用?Java VcsDirtyScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

VcsDirtyScope类属于com.intellij.openapi.vcs.changes包,在下文中一共展示了VcsDirtyScope类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getChanges

点赞 3

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public void getChanges(final VcsDirtyScope dirtyScope, final ChangelistBuilder builder, final ProgressIndicator progress,
                       final ChangeListManagerGate addGate)
  throws VcsException {
  synchronized (myLock) {
    if (myExecuteInsideUpdate == null) {
      return;
    }

    myLocked = true;
    myExecuteInsideUpdate.start();

    while (myLocked) {
      try {
        myLock.wait();
      }
      catch (InterruptedException e) {
        //
      }
    }
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:22,
代码来源:MockDelayingChangeProvider.java

示例2: clearScope

点赞 3

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public void clearScope(final List<VcsDirtyScope> scopes) {
  synchronized (myLock) {
    ++ myCounter;
    for (final VcsDirtyScope scope : scopes) {
      final Set<CurrentKey> toRemove = new HashSet<CurrentKey>();
      myCurrentRevisionsCache.iterateKeys(new Consumer<CurrentKey>() {
        @Override
        public void consume(CurrentKey currentKey) {
          if (scope.belongsTo(currentKey.getPath())) {
            toRemove.add(currentKey);
          }
        }
      });
      for (CurrentKey key : toRemove) {
        myCurrentRevisionsCache.remove(key);
      }
    }
  }
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:20,
代码来源:ContentRevisionCache.java

示例3: clearScope

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public void clearScope(final List<VcsDirtyScope> scopes) {
  // VcsDirtyScope.belongsTo() performs some checks under read action. So deadlock could occur if some thread tries to modify
  // ContentRevisionCache (i.e. call getOrLoadCurrentAsBytes()) under write action while other thread invokes clearScope(). To prevent
  // such deadlocks we also perform locking "myLock" (and other logic) under read action.
  // TODO: "myCurrentRevisionsCache" logic should be refactored to be more clear and possibly to avoid creating such wrapping read actions
  ApplicationManager.getApplication().runReadAction(new Runnable() {
    @Override
    public void run() {
      synchronized (myLock) {
        ++myCounter;
        for (final VcsDirtyScope scope : scopes) {
          final Set<CurrentKey> toRemove = new HashSet<CurrentKey>();
          myCurrentRevisionsCache.iterateKeys(new Consumer<CurrentKey>() {
            @Override
            public void consume(CurrentKey currentKey) {
              if (scope.belongsTo(currentKey.getPath())) {
                toRemove.add(currentKey);
              }
            }
          });
          for (CurrentKey key : toRemove) {
            myCurrentRevisionsCache.remove(key);
          }
        }
      }
    }
  });
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:29,
代码来源:ContentRevisionCache.java

示例4: GitChangesCollector

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
GitChangesCollector(@NotNull Project project, @NotNull ChangeListManager changeListManager, @NotNull ProjectLevelVcsManager vcsManager,
                    @NotNull AbstractVcs vcs, @NotNull VcsDirtyScope dirtyScope, @NotNull VirtualFile vcsRoot) {
  myProject = project;
  myChangeListManager = changeListManager;
  myVcsManager = vcsManager;
  myVcs = vcs;
  myDirtyScope = dirtyScope;
  myVcsRoot = vcsRoot;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:10,
代码来源:GitChangesCollector.java

示例5: collect

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
/**
 * Collects the changes from git command line and returns the instance of GitNewChangesCollector from which these changes can be retrieved.
 * This may be lengthy.
 */
@NotNull
static GitOldChangesCollector collect(@NotNull Project project, @NotNull ChangeListManager changeListManager,
                                      @NotNull ProjectLevelVcsManager vcsManager, @NotNull AbstractVcs vcs,
                                      @NotNull VcsDirtyScope dirtyScope, @NotNull VirtualFile vcsRoot) throws VcsException {
  return new GitOldChangesCollector(project, changeListManager, vcsManager, vcs, dirtyScope, vcsRoot);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:GitOldChangesCollector.java

示例6: GitOldChangesCollector

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
private GitOldChangesCollector(@NotNull Project project, @NotNull ChangeListManager changeListManager,
                               @NotNull ProjectLevelVcsManager vcsManager, @NotNull AbstractVcs vcs, @NotNull VcsDirtyScope dirtyScope,
                               @NotNull VirtualFile vcsRoot) throws VcsException {
  super(project, changeListManager, vcsManager, vcs, dirtyScope, vcsRoot);
  updateIndex();
  collectUnmergedAndUnversioned();
  collectDiffChanges();
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:9,
代码来源:GitOldChangesCollector.java

示例7: collect

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
/**
 * Collects the changes from git command line and returns the instance of GitNewChangesCollector from which these changes can be retrieved.
 * This may be lengthy.
 */
@NotNull
static GitNewChangesCollector collect(@NotNull Project project, @NotNull Git git, @NotNull ChangeListManager changeListManager,
                                      @NotNull ProjectLevelVcsManager vcsManager, @NotNull AbstractVcs vcs,
                                      @NotNull VcsDirtyScope dirtyScope, @NotNull VirtualFile vcsRoot) throws VcsException {
  return new GitNewChangesCollector(project, git, changeListManager, vcsManager, vcs, dirtyScope, vcsRoot);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:GitNewChangesCollector.java

示例8: GitNewChangesCollector

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
private GitNewChangesCollector(@NotNull Project project, @NotNull Git git, @NotNull ChangeListManager changeListManager,
                               @NotNull ProjectLevelVcsManager vcsManager, @NotNull AbstractVcs vcs,
                               @NotNull VcsDirtyScope dirtyScope, @NotNull VirtualFile vcsRoot) throws VcsException
{
  super(project, changeListManager, vcsManager, vcs, dirtyScope, vcsRoot);
  myGit = git;
  myRepository = GitUtil.getRepositoryManager(myProject).getRepositoryForRoot(vcsRoot);

  Collection<FilePath> dirtyPaths = dirtyPaths(true);
  if (!dirtyPaths.isEmpty()) {
    collectChanges(dirtyPaths);
    collectUnversionedFiles();
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:15,
代码来源:GitNewChangesCollector.java

示例9: clearScope

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public void clearScope(final List<VcsDirtyScope> scopes) {
  // VcsDirtyScope.belongsTo() performs some checks under read action. So deadlock could occur if some thread tries to modify
  // ContentRevisionCache (i.e. call getOrLoadCurrentAsBytes()) under write action while other thread invokes clearScope(). To prevent
  // such deadlocks we also perform locking "myLock" (and other logic) under read action.
  // TODO: "myCurrentRevisionsCache" logic should be refactored to be more clear and possibly to avoid creating such wrapping read actions
  ApplicationManager.getApplication().runReadAction(new Runnable() {
    @Override
    public void run() {
      synchronized (myLock) {
        ++myCounter;
        for (final VcsDirtyScope scope : scopes) {
          final Set<CurrentKey> toRemove = new HashSet<>();
          myCurrentRevisionsCache.iterateKeys(new Consumer<CurrentKey>() {
            @Override
            public void consume(CurrentKey currentKey) {
              if (scope.belongsTo(currentKey.getPath())) {
                toRemove.add(currentKey);
              }
            }
          });
          for (CurrentKey key : toRemove) {
            myCurrentRevisionsCache.remove(key);
          }
        }
      }
    }
  });
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:29,
代码来源:ContentRevisionCache.java

示例10: SvnScopeZipper

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public SvnScopeZipper(@NotNull VcsDirtyScope in) {
  myIn = in;
  myRecursiveDirs = ContainerUtil.newArrayList(in.getRecursivelyDirtyDirectories());
  myNonRecursiveDirs = ContainerUtil.newHashMap();
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:SvnScopeZipper.java

示例11: getChanges

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public void getChanges(@NotNull final VcsDirtyScope dirtyScope,
                       @NotNull final ChangelistBuilder builder,
                       @NotNull final ProgressIndicator progress,
                       @NotNull final ChangeListManagerGate addGate) throws VcsException {

    if (myProject.isDisposed()) {
        return;
    }
    if (builder == null) {
        return;
    }

    progress.setText("Processing changes");

    // process only roots, filter out child items since requests are recursive anyway
    RootsCollection.FilePathRootsCollection roots = new RootsCollection.FilePathRootsCollection();
    roots.addAll(dirtyScope.getRecursivelyDirtyDirectories());

    final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
    for (FilePath dirtyFile : dirtyScope.getDirtyFiles()) {
        // workaround for IDEADEV-31511 and IDEADEV-31721
        if (dirtyFile.getVirtualFile() == null || !changeListManager.isIgnoredFile(dirtyFile.getVirtualFile())) {
            roots.add(dirtyFile);
        }
    }

    if (roots.isEmpty()) {
        return;
    }

    final ChangelistBuilderStatusVisitor changelistBuilderStatusVisitor = new ChangelistBuilderStatusVisitor(myProject, builder);

    for (final FilePath root : roots) {
        // if we get a change notification in the $tf folder, we need to just ignore it
        if (StringUtils.containsIgnoreCase(root.getPath(), "$tf") ||
                StringUtils.containsIgnoreCase(root.getPath(), ".tf")) {
            continue;
        }

        List<PendingChange> changes;
        try {
            // TODO: add the ability to pass multiple roots to the command line
            final Command<List<PendingChange>> command = new StatusCommand(null, root.getPath());
            changes = command.runSynchronously();
        } catch (final Throwable t) {
            logger.warn("Failed to get changes from command line. root=" + root.getPath(), t);
            changes = Collections.emptyList();
        }

        // for each change, find out the status of the changes and then add to the list
        for (final PendingChange change : changes) {
            try {
                StatusProvider.visitByStatus(changelistBuilderStatusVisitor, change);
            } catch (TfsException e) {
                throw new VcsException(e.getMessage(), e);
            }
        }
    }
}
 

开发者ID:Microsoft,
项目名称:vso-intellij,
代码行数:60,
代码来源:TFSChangeProvider.java

示例12: SvnScopeZipper

点赞 2

import com.intellij.openapi.vcs.changes.VcsDirtyScope; //导入依赖的package包/类
public SvnScopeZipper(final VcsDirtyScope in) {
  myIn = in;
  myRecursiveDirs = new ArrayList<FilePath>(in.getRecursivelyDirtyDirectories());
  myNonRecursiveDirs = new HashMap<String, MyDirNonRecursive>();
  mySingleFiles = new ArrayList<FilePath>();
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:7,
代码来源:SvnScopeZipper.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)