当前位置: 首页>>代码示例>>Java>>正文


Java FilePath.equals方法代码示例

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


在下文中一共展示了FilePath.equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeRegisteredChangeFor

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@Override
public void removeRegisteredChangeFor(FilePath path) {
  for (Iterator<Change> iterator = myChanges.iterator(); iterator.hasNext(); ) {
    final Change change = iterator.next();
    if (path.equals(ChangesUtil.getFilePath(change))) {
      iterator.remove();
      return;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MockChangelistBuilder.java

示例2: getFirstCommitParentAndPathIfRename

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
/**
 * Gets info of the given commit and checks if it was a RENAME.
 * If yes, returns the older file path, which file was renamed from.
 * If it's not a rename, returns null.
 */
@Nullable
private static Pair<String, FilePath> getFirstCommitParentAndPathIfRename(Project project,
                                                                          VirtualFile root,
                                                                          String commit,
                                                                          FilePath filePath,
                                                                          @NotNull GitVersion version) throws VcsException {
  // 'git show -M --name-status <commit hash>' returns the information about commit and detects renames.
  // NB: we can't specify the filepath, because then rename detection will work only with the '--follow' option, which we don't wanna use.
  final GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.SHOW);
  final GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, HASH, COMMIT_TIME, PARENTS);
  h.setStdoutSuppressed(true);
  h.addParameters("-M", "--name-status", parser.getPretty(), "--encoding=UTF-8", commit);
  if (!GitVersionSpecialty.FOLLOW_IS_BUGGY_IN_THE_LOG.existsIn(version)) {
    h.addParameters("--follow");
    h.endOptions();
    h.addRelativePaths(filePath);
  }
  else {
    h.endOptions();
  }
  final String output = h.run();
  final List<GitLogRecord> records = parser.parse(output);

  if (records.isEmpty()) return null;
  // we have information about all changed files of the commit. Extracting information about the file we need.
  GitLogRecord record = records.get(0);
  final List<Change> changes = record.parseChanges(project, root);
  for (Change change : changes) {
    if ((change.isMoved() || change.isRenamed()) && filePath.equals(change.getAfterRevision().getFile())) {
      final String[] parents = record.getParentsHashes();
      String parent = parents.length > 0 ? parents[0] : null;
      return Pair.create(parent, change.getBeforeRevision().getFile());
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:GitHistoryUtils.java

示例3: removeRegisteredChangeFor

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@Override
public void removeRegisteredChangeFor(FilePath path) {
  // not sure
  for (Iterator<Change> iterator = myChanges.iterator(); iterator.hasNext(); ) {
    final Change change = iterator.next();
    if (path.equals(ChangesUtil.getFilePath(change))) {
      final VirtualFile vf = path.getVirtualFile();
      if (vf != null) {
        myCheckSet.remove(vf);
        iterator.remove();
        return;
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GatheringChangelistBuilder.java


注:本文中的com.intellij.openapi.vcs.FilePath.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。