Expose the DiffComparator choice as an url parameter (?w=1)
| | |
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.FederationModel;
|
| | | import com.gitblit.models.Metric;
|
| | | import com.gitblit.utils.DiffUtils.DiffComparator;
|
| | | import com.gitblit.utils.HttpUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.utils.TimeUtils;
|
| | |
| | | return params.getString("st", null);
|
| | | }
|
| | |
|
| | | public static DiffComparator getDiffComparator(PageParameters params) {
|
| | | int ordinal = params.getInt("w", 0);
|
| | | return DiffComparator.values()[ordinal];
|
| | | }
|
| | |
|
| | | public static int getPage(PageParameters params) {
|
| | | // index from 1
|
| | | return params.getInt("pg", 1);
|
| | |
| | |
|
| | | final String blobPath = WicketUtils.getPath(params);
|
| | | final String baseObjectId = WicketUtils.getBaseObjectId(params);
|
| | | final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL;
|
| | | final DiffComparator diffComparator = WicketUtils.getDiffComparator(params);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = getCommit();
|
| | |
| | | RevCommit baseCommit = JGitUtils.getCommit(r, baseObjectId);
|
| | | ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName,
|
| | | baseCommit.getName(), commit.getName(), imageExtensions);
|
| | | diff = DiffUtils.getDiff(r, baseCommit, commit, blobPath, DiffComparator.WS_IGNORE_ALL, DiffOutputType.HTML, handler).content;
|
| | | diff = DiffUtils.getDiff(r, baseCommit, commit, blobPath, diffComparator, DiffOutputType.HTML, handler).content;
|
| | | if (handler.getImgDiffCount() > 0) {
|
| | | addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs
|
| | | }
|
| | |
| | | final ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName, |
| | | parents.isEmpty() ? null : parents.get(0), commit.getName(), imageExtensions); |
| | | |
| | | final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL; |
| | | final DiffComparator diffComparator = WicketUtils.getDiffComparator(params); |
| | | final DiffOutput diff = DiffUtils.getCommitDiff(r, commit, diffComparator, DiffOutputType.HTML, handler); |
| | | if (handler.getImgDiffCount() > 0) { |
| | | addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs |
| | |
| | | final ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName, |
| | | fromCommit.getName(), toCommit.getName(), imageExtensions); |
| | | |
| | | final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL; |
| | | final DiffComparator diffComparator = WicketUtils.getDiffComparator(params); |
| | | final DiffOutput diff = DiffUtils.getDiff(r, fromCommit, toCommit, diffComparator, DiffOutputType.HTML, handler); |
| | | if (handler.getImgDiffCount() > 0) { |
| | | addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs |