use of com.google.gitiles.DateFormatter in project gitiles by GerritCodeReview.
the class BlameServlet method doGetHtml.
@Override
protected void doGetHtml(HttpServletRequest req, HttpServletResponse res) throws IOException {
GitilesView view = ViewFilter.getView(req);
Repository repo = ServletUtils.getRepository(req);
try (RevWalk rw = new RevWalk(repo)) {
GitilesAccess access = getAccess(req);
RegionResult result = getRegions(view, access, repo, rw, res);
if (result == null) {
return;
}
String title = "Blame - " + view.getPathPart();
Map<String, ?> blobData = new BlobSoyData(rw.getObjectReader(), view).toSoyData(view.getPathPart(), result.blobId);
if (blobData.get("lines") != null) {
DateFormatter df = new DateFormatter(access, Format.ISO);
renderHtml(req, res, "gitiles.blameDetail", ImmutableMap.of("title", title, "breadcrumbs", view.getBreadcrumbs(), "data", blobData, "regions", toSoyData(view, rw.getObjectReader(), result.regions, df)));
} else {
renderHtml(req, res, "gitiles.blameDetail", ImmutableMap.of("title", title, "breadcrumbs", view.getBreadcrumbs(), "data", blobData));
}
}
}
Aggregations