James Moger
2013-05-23 0b2232c34d8e087df7c29e8771318964b8a3d9c5
Removed commitdiff code code for comparing ranges (issue-133)

This feature was incomplete, reported incorrect information, and has
been replaced by the compare page (issue-75).
1 files modified
45 ■■■■■ changed files
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java
@@ -15,7 +15,6 @@
 */
package com.gitblit.wicket.pages;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -52,29 +51,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) {
@@ -98,16 +77,7 @@
        add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
        // changed paths list
        List<PathChangeModel> paths;
        if( otherCommit == null )
        {
            paths = JGitUtils.getFilesInCommit(r, commit);
        }
        else
        {
            paths = JGitUtils.getFilesInCommit(r, otherCommit);
        }
        List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);
        add(new CommitLegendPanel("commitLegend", paths));
        ListDataProvider<PathChangeModel> pathsDp = new ListDataProvider<PathChangeModel>(paths);
@@ -187,14 +157,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;
    }
}