mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +01:00
improve blame api and description to blameline
This commit is contained in:
@@ -56,17 +56,19 @@ public class BlameLine
|
||||
* @param author
|
||||
* @param when
|
||||
* @param revision
|
||||
* @param description
|
||||
* @param code
|
||||
* @param lineNumber
|
||||
*/
|
||||
public BlameLine(Person author, Long when, String revision, String code,
|
||||
int lineNumber)
|
||||
public BlameLine(int lineNumber, String revision, Long when, Person author,
|
||||
String description, String code)
|
||||
{
|
||||
this.author = author;
|
||||
this.when = when;
|
||||
this.revision = revision;
|
||||
this.code = code;
|
||||
this.lineNumber = lineNumber;
|
||||
this.revision = revision;
|
||||
this.when = when;
|
||||
this.author = author;
|
||||
this.description = description;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -93,6 +95,17 @@ public class BlameLine
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -150,6 +163,17 @@ public class BlameLine
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param description
|
||||
*/
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -191,6 +215,9 @@ public class BlameLine
|
||||
/** Field description */
|
||||
private String code;
|
||||
|
||||
/** Field description */
|
||||
private String description;
|
||||
|
||||
/** Field description */
|
||||
private int lineNumber;
|
||||
|
||||
|
||||
@@ -133,6 +133,9 @@ public class GitBlameViewer implements BlameViewer
|
||||
author.getEmailAddress()));
|
||||
|
||||
RevCommit commit = gitBlameResult.getSourceCommit(i);
|
||||
|
||||
blameLine.setDescription(commit.getShortMessage());
|
||||
|
||||
long when = GitUtil.getCommitTime(commit);
|
||||
|
||||
blameLine.setWhen(when);
|
||||
|
||||
@@ -216,7 +216,8 @@ public class HgBlameViewer implements BlameViewer
|
||||
// todo parse date
|
||||
Long when = getDate(m.group(3));
|
||||
|
||||
blameLine = new BlameLine(authorPerson, when, m.group(2), m.group(5), nr);
|
||||
blameLine = new BlameLine(nr, m.group(2), when, authorPerson, null,
|
||||
m.group(5));
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
|
||||
@@ -132,8 +132,8 @@ public class SvnBlameHandler implements ISVNAnnotateHandler
|
||||
when = date.getTime();
|
||||
}
|
||||
|
||||
blameLines.add(new BlameLine(authorPerson, when, String.valueOf(revision),
|
||||
line, lineNumber + 1));
|
||||
blameLines.add(new BlameLine(lineNumber + 1, String.valueOf(revision),
|
||||
when, authorPerson, null, line));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user