mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 11:05:56 +01:00
use long instead of date
This commit is contained in:
@@ -33,10 +33,6 @@
|
|||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class description
|
* Class description
|
||||||
*
|
*
|
||||||
@@ -63,7 +59,7 @@ public class BlameLine
|
|||||||
* @param code
|
* @param code
|
||||||
* @param lineNumber
|
* @param lineNumber
|
||||||
*/
|
*/
|
||||||
public BlameLine(Person author, Date when, String revision, String code,
|
public BlameLine(Person author, Long when, String revision, String code,
|
||||||
int lineNumber)
|
int lineNumber)
|
||||||
{
|
{
|
||||||
this.author = author;
|
this.author = author;
|
||||||
@@ -125,7 +121,7 @@ public class BlameLine
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Date getWhen()
|
public Long getWhen()
|
||||||
{
|
{
|
||||||
return when;
|
return when;
|
||||||
}
|
}
|
||||||
@@ -182,7 +178,7 @@ public class BlameLine
|
|||||||
*
|
*
|
||||||
* @param when
|
* @param when
|
||||||
*/
|
*/
|
||||||
public void setWhen(Date when)
|
public void setWhen(Long when)
|
||||||
{
|
{
|
||||||
this.when = when;
|
this.when = when;
|
||||||
}
|
}
|
||||||
@@ -202,5 +198,5 @@ public class BlameLine
|
|||||||
private String revision;
|
private String revision;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Date when;
|
private Long when;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.eclipse.jgit.api.BlameCommand;
|
|||||||
import org.eclipse.jgit.api.Git;
|
import org.eclipse.jgit.api.Git;
|
||||||
import org.eclipse.jgit.blame.BlameResult;
|
import org.eclipse.jgit.blame.BlameResult;
|
||||||
import org.eclipse.jgit.lib.PersonIdent;
|
import org.eclipse.jgit.lib.PersonIdent;
|
||||||
|
import org.eclipse.jgit.revwalk.RevCommit;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -127,9 +128,13 @@ public class GitBlameViewer implements BlameViewer
|
|||||||
blameLine.setLineNumber(i);
|
blameLine.setLineNumber(i);
|
||||||
blameLine.setAuthor(new Person(author.getName(),
|
blameLine.setAuthor(new Person(author.getName(),
|
||||||
author.getEmailAddress()));
|
author.getEmailAddress()));
|
||||||
blameLine.setWhen(author.getWhen());
|
|
||||||
|
|
||||||
String rev = blameResult.getSourceCommit(i).getId().getName();
|
RevCommit commit = blameResult.getSourceCommit(i);
|
||||||
|
long when = GitUtil.getCommitTime(commit);
|
||||||
|
|
||||||
|
blameLine.setWhen(when);
|
||||||
|
|
||||||
|
String rev = commit.getId().getName();
|
||||||
|
|
||||||
blameLine.setRevision(rev);
|
blameLine.setRevision(rev);
|
||||||
|
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ public class SvnBlameHandler implements ISVNAnnotateHandler
|
|||||||
authorPerson = new Person(author);
|
authorPerson = new Person(author);
|
||||||
}
|
}
|
||||||
|
|
||||||
blameLines.add(new BlameLine(authorPerson, date, String.valueOf(revision),
|
blameLines.add(new BlameLine(authorPerson, date.getTime(),
|
||||||
line, lineNumber));
|
String.valueOf(revision), line, lineNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user