use of org.zmlx.hg4idea.command.mq.HgQGotoCommand in project intellij-community by JetBrains.
the class HgQGotoFromLogAction method actionPerformed.
protected void actionPerformed(@NotNull final HgRepository repository, @NotNull final VcsFullCommitDetails commit) {
final Project project = repository.getProject();
List<Hash> parents = commit.getParents();
final Hash parentHash = parents.isEmpty() ? null : parents.get(0);
final HgNameWithHashInfo parentPatchName = ContainerUtil.find(repository.getMQAppliedPatches(), new Condition<HgNameWithHashInfo>() {
@Override
public boolean value(HgNameWithHashInfo info) {
return info.getHash().equals(parentHash);
}
});
new Task.Backgroundable(repository.getProject(), parentPatchName != null ? HgVcsMessages.message("hg4idea.mq.progress.goto", parentPatchName) : HgVcsMessages.message("hg4idea.mq.progress.pop")) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
if (parentPatchName != null) {
new HgQGotoCommand(repository).executeInCurrentThread(parentPatchName.getName());
} else {
new HgQPopCommand(repository).executeInCurrentThread();
}
}
@Override
public void onSuccess() {
HgShowUnAppliedPatchesAction.showUnAppliedPatches(project, repository);
}
}.queue();
}
Aggregations