[hg]: delete never thrown exception handle

This commit is contained in:
Nadya Zabrodina
2016-03-26 12:51:39 +03:00
parent 8107138dfb
commit 44b5bf1039
3 changed files with 4 additions and 28 deletions
@@ -80,8 +80,7 @@ public class HgLogCommand {
/**
* @param limit Pass -1 to set no limits on history
*/
public final List<HgFileRevision> execute(final HgFile hgFile, int limit, boolean includeFiles, @Nullable List<String> argsForCmd)
throws HgCommandException {
public final List<HgFileRevision> execute(final HgFile hgFile, int limit, boolean includeFiles, @Nullable List<String> argsForCmd) {
if ((limit <= 0 && limit != -1) || hgFile == null) {
return Collections.emptyList();
}
@@ -38,9 +38,7 @@ import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.zmlx.hg4idea.*;
import org.zmlx.hg4idea.action.HgCommandResultNotifier;
import org.zmlx.hg4idea.command.HgLogCommand;
import org.zmlx.hg4idea.execution.HgCommandException;
import org.zmlx.hg4idea.ui.HgVersionFilterComponent;
import org.zmlx.hg4idea.util.HgUtil;
@@ -223,13 +221,7 @@ public class HgCachingCommittedChangesProvider implements CachingCommittedChange
}
}
final List<HgFileRevision> localRevisions;
try {
localRevisions = hgLogCommand.execute(hgFile, maxCount == 0 ? -1 : maxCount, true, args);
}
catch (HgCommandException e) {
new HgCommandResultNotifier(project).notifyError(null, HgVcsMessages.message("hg4idea.error.log.command.execution"), e.getMessage());
return result;
}
localRevisions = hgLogCommand.execute(hgFile, maxCount == 0 ? -1 : maxCount, true, args);
Collections.reverse(localRevisions);
for (HgFileRevision revision : localRevisions) {
@@ -342,13 +334,7 @@ public class HgCachingCommittedChangesProvider implements CachingCommittedChange
args.add("--rev");
args.add(revision);
final List<HgFileRevision> revisions;
try {
revisions = hgLogCommand.execute(hgFile, 1, true, args);
}
catch (HgCommandException e) {
new HgCommandResultNotifier(project).notifyError(null, HgVcsMessages.message("hg4idea.error.log.command.execution"), e.getMessage());
return null;
}
revisions = hgLogCommand.execute(hgFile, 1, true, args);
if (ContainerUtil.isEmpty(revisions)) {
return null;
}
@@ -29,11 +29,8 @@ import org.jetbrains.annotations.Nullable;
import org.zmlx.hg4idea.HgFile;
import org.zmlx.hg4idea.HgFileRevision;
import org.zmlx.hg4idea.HgRevisionNumber;
import org.zmlx.hg4idea.HgVcsMessages;
import org.zmlx.hg4idea.action.HgCommandResultNotifier;
import org.zmlx.hg4idea.command.HgLogCommand;
import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
import org.zmlx.hg4idea.execution.HgCommandException;
import org.zmlx.hg4idea.util.HgUtil;
import javax.swing.*;
@@ -129,13 +126,7 @@ public class HgHistoryProvider implements VcsHistoryProvider {
args.add("--rev");
args.add("reverse(0::" + revNumberAsArg + ")"); // without --follow was 0:tip by default without --rev;
// reverse needed because of mercurial default order problem -r revset with and without -f option
try {
return logCommand.execute(new HgFile(vcsRoot, filePath), limit, false, args);
}
catch (HgCommandException e) {
new HgCommandResultNotifier(project).notifyError(null, HgVcsMessages.message("hg4idea.error.log.command.execution"), e.getMessage());
return Collections.emptyList();
}
return logCommand.execute(new HgFile(vcsRoot, filePath), limit, false, args);
}
public boolean supportsHistoryForDirectories() {