From 5aec867b2fae0ff039d0ca4228ccceadecf316c9 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 14 Jul 2013 12:04:52 -0400
Subject: [PATCH] Added release script template and build.xml adjustments
---
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java | 52 ++++++++++------------------------------------------
1 files changed, 10 insertions(+), 42 deletions(-)
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
index cfdb863..6954808 100644
--- a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
@@ -15,8 +15,8 @@
*/
package com.gitblit.wicket.pages;
-import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.wicket.PageParameters;
@@ -30,9 +30,11 @@
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.Constants;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.models.PathModel.PathChangeModel;
+import com.gitblit.models.GitNote;
import com.gitblit.models.SubmoduleModel;
import com.gitblit.utils.DiffUtils;
import com.gitblit.utils.DiffUtils.DiffOutputType;
@@ -40,7 +42,9 @@
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.CommitHeaderPanel;
import com.gitblit.wicket.panels.CommitLegendPanel;
+import com.gitblit.wicket.panels.GravatarImage;
import com.gitblit.wicket.panels.LinkPanel;
+import com.gitblit.wicket.panels.RefsPanel;
public class CommitDiffPage extends RepositoryPage {
@@ -52,29 +56,9 @@
DiffOutputType diffType = DiffOutputType.forName(GitBlit.getString(Keys.web.diffStyle,
DiffOutputType.GITBLIT.name()));
- RevCommit commit = null, otherCommit = null;
+ RevCommit commit = getCommit();
- if( objectId.contains("..") )
- {
- String[] parts = objectId.split("\\.\\.");
- commit = getCommit(r, parts[0]);
- otherCommit = getCommit(r, parts[1]);
- }
- else
- {
- commit = getCommit();
- }
-
- String diff;
-
- if(otherCommit == null)
- {
- diff = DiffUtils.getCommitDiff(r, commit, diffType);
- }
- else
- {
- diff = DiffUtils.getDiff(r, commit, otherCommit, diffType);
- }
+ String diff = DiffUtils.getCommitDiff(r, commit, diffType);
List<String> parents = new ArrayList<String>();
if (commit.getParentCount() > 0) {
@@ -97,17 +81,10 @@
add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
- // changed paths list
- List<PathChangeModel> paths;
+ addFullText("fullMessage", commit.getFullMessage(), true);
- if( otherCommit == null )
- {
- paths = JGitUtils.getFilesInCommit(r, commit);
- }
- else
- {
- paths = JGitUtils.getFilesInCommit(r, otherCommit);
- }
+ // changed paths list
+ List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);
add(new CommitLegendPanel("commitLegend", paths));
ListDataProvider<PathChangeModel> pathsDp = new ListDataProvider<PathChangeModel>(paths);
@@ -187,14 +164,5 @@
@Override
protected Class<? extends BasePage> getRepoNavPageClass() {
return LogPage.class;
- }
-
- private RevCommit getCommit(Repository r, String rev)
- {
- RevCommit otherCommit = JGitUtils.getCommit(r, rev);
- if (otherCommit == null) {
- error(MessageFormat.format(getString("gb.failedToFindCommit"), rev, repositoryName, getPageName()), true);
- }
- return otherCommit;
}
}
--
Gitblit v1.9.1