use of org.rstudio.studio.client.workbench.views.vcs.common.diff.DiffParser in project rstudio by rstudio.
the class HistoryPresenter method showCommitDetail.
private void showCommitDetail(boolean noSizeWarning) {
final CommitInfo commitInfo = view_.getCommitList().getSelectedCommit();
if (!noSizeWarning && commitInfo != null && commitInfo.getId().equals(commitShowing_)) {
return;
}
commitShowing_ = null;
view_.hideSizeWarning();
view_.getCommitDetail().setSelectedCommit(commitInfo);
view_.getCommitDetail().showDetailProgress();
invalidation_.invalidate();
if (commitInfo == null)
return;
final Token token = invalidation_.getInvalidationToken();
strategy_.showCommit(commitInfo.getId(), noSizeWarning, new SimpleRequestCallback<String>() {
@Override
public void onResponseReceived(String response) {
super.onResponseReceived(response);
if (token.isInvalid())
return;
DiffParser parser = strategy_.createParserForCommit(response);
view_.getCommitDetail().setDetails(parser, !strategy_.isShowFileSupported());
commitShowing_ = commitInfo.getId();
}
@Override
public void onError(ServerError error) {
commitShowing_ = null;
JSONNumber size = error.getClientInfo().isNumber();
if (size != null)
view_.showSizeWarning((long) size.doubleValue());
else if (strategy_.getShowHistoryErrors())
super.onError(error);
else
Debug.logError(error);
}
});
}
Aggregations