merge with branch issue-474

This commit is contained in:
Sebastian Sdorra
2013-12-13 08:08:47 +01:00
4 changed files with 23 additions and 7 deletions

View File

@@ -83,7 +83,6 @@ public class GitChangesetConverter implements Closeable
*
*
* @param repository
* @param idLength
*/
public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository)
{
@@ -96,7 +95,6 @@ public class GitChangesetConverter implements Closeable
*
* @param repository
* @param revWalk
* @param idLength
*/
public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository,
RevWalk revWalk)
@@ -195,7 +193,13 @@ public class GitChangesetConverter implements Closeable
PersonIdent authorIndent = commit.getAuthorIdent();
Person author = new Person(authorIndent.getName(),
authorIndent.getEmailAddress());
String message = commit.getShortMessage();
String message = commit.getFullMessage();
if (message != null)
{
message = message.trim();
}
Changeset changeset = new Changeset(id, date, author, message);
if (parentList != null)
@@ -214,6 +218,7 @@ public class GitChangesetConverter implements Closeable
if (Util.isNotEmpty(tagCollection))
{
// create a copy of the tag collection to reduce memory on caching
changeset.getTags().addAll(Lists.newArrayList(tagCollection));
}

View File

@@ -54,6 +54,13 @@ Ext.apply(Ext.util.Format, {
id: function(value){
return this.substr(value, 0, 12);
},
convertLineBreaks: function(value){
if (value){
value = value.replace(/(\r\n|\n|\r)/gm, "<br />");
}
return value;
}
});

View File

@@ -174,9 +174,13 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
}
}
var description = record.data.description;
// if ( description ){
// description = Ext.util.Format.htmlEncode(description);
// }
if ( description ){
// description = Ext.util.Format.htmlEncode(description);
var index = description.indexOf('\n');
if ( index > 0 ){
description = description.substring(0, index) + " ...";
}
}
var date = record.data.date;
if ( date ){
date = Ext.util.Format.formatTimestamp(date);

View File

@@ -45,7 +45,7 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
</div>\n\
<div class="left-content left-side">\n\
<h1>Commit {id}</h1>\n\
<p>{description}</p>\n\
<p>{description:convertLineBreaks}</p>\n\
<p>\n\
<tpl for="author">\n\
{name}<tpl if="mail"> &lt;<a href="mailto:{mail}">{mail}</a>&gt;</tpl>\n\