本文整理汇总了Java中com.intellij.openapi.vcs.VcsException.getMessages方法的典型用法代码示例。如果您正苦于以下问题:Java VcsException.getMessages方法的具体用法?Java VcsException.getMessages怎么用?Java VcsException.getMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.VcsException
的用法示例。
在下文中一共展示了VcsException.getMessages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeOperation
import com.intellij.openapi.vcs.VcsException; //导入方法依赖的package包/类
private AnnotateOperation executeOperation(File file, String revision, CvsEnvironment root, boolean binary, boolean retryOnFailure)
throws VcsException {
final AnnotateOperation operation = new AnnotateOperation(file, revision, root, binary);
final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.performActionSync(new CommandCvsHandler(CvsBundle.getAnnotateOperationName(), operation), CvsOperationExecutorCallback.EMPTY);
final CvsResult result = executor.getResult();
if (result.hasErrors()) {
if (!retryOnFailure) {
throw result.composeError();
}
for (VcsException error : result.getErrors()) {
for (String message : error.getMessages()) {
if (message.contains(INVALID_OPTION_F) || message.contains(USAGE_CVSNTSRV_SERVER)) {
ourDoNotAnnotateBinaryRoots.add(root.getCvsRootAsString());
return executeOperation(file, revision, root, false, false);
}
}
}
throw result.composeError();
}
return operation;
}
示例2: stringifyErrors
import com.intellij.openapi.vcs.VcsException; //导入方法依赖的package包/类
/**
* Splits the given VcsExceptions to one string. Exceptions are separated by <br/>
* Line separator is also replaced by <br/>
*/
public static @NotNull String stringifyErrors(@Nullable Collection<VcsException> errors) {
if (errors == null) {
return "";
}
StringBuilder content = new StringBuilder();
for (VcsException e : errors) {
for (String message : e.getMessages()) {
content.append(message.replace("\n", "<br/>")).append("<br/>");
}
}
return content.toString();
}
示例3: run
import com.intellij.openapi.vcs.VcsException; //导入方法依赖的package包/类
public CvsResult run(Project project) {
final CvsResult executionResult = internalRun(project);
for (VcsException error : executionResult.getErrors()) {
for (String message : error.getMessages()) {
if (message.contains(INVALID_OPTION_S)) {
disableSuppressEmptyHeadersForCurrentCvsRoot();
// try only once
return internalRun(project);
}
}
}
return executionResult;
}