本文整理汇总了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;
}
}
}
示例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;
}
示例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;
}
}
}
}