|
|
@@ -58,7 +58,6 @@ import java.util.Comparator; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.TreeMap; |
|
|
@@ -88,7 +87,6 @@ import org.eclipse.jgit.lib.ObjectLoader; |
|
|
|
import org.eclipse.jgit.lib.PersonIdent; |
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
import org.eclipse.jgit.lib.WindowCursor; |
|
|
|
import org.eclipse.jgit.revwalk.FooterKey; |
|
|
|
import org.eclipse.jgit.revwalk.RevCommit; |
|
|
|
import org.eclipse.jgit.revwalk.RevTree; |
|
|
|
import org.eclipse.jgit.revwalk.RevWalk; |
|
|
@@ -111,8 +109,6 @@ public class IpLogGenerator { |
|
|
|
|
|
|
|
private static final String INDENT = "{http://xml.apache.org/xslt}indent-amount"; |
|
|
|
|
|
|
|
private static final FooterKey BUG = new FooterKey("Bug"); |
|
|
|
|
|
|
|
/** Projects indexed by their ID string, e.g. {@code technology.jgit}. */ |
|
|
|
private final Map<String, Project> projects = new TreeMap<String, Project>(); |
|
|
|
|
|
|
@@ -137,6 +133,9 @@ public class IpLogGenerator { |
|
|
|
/** The meta file we loaded to bootstrap our definitions. */ |
|
|
|
private IpLogMeta meta; |
|
|
|
|
|
|
|
/** URL to obtain review information about a specific contribution. */ |
|
|
|
private String reviewUrl; |
|
|
|
|
|
|
|
private String characterEncoding = "UTF-8"; |
|
|
|
|
|
|
|
private Repository db; |
|
|
@@ -230,6 +229,7 @@ public class IpLogGenerator { |
|
|
|
consumedProjects.put(p.getName(), p); |
|
|
|
} |
|
|
|
cqs.addAll(meta.getCQs()); |
|
|
|
reviewUrl = meta.getReviewUrl(); |
|
|
|
} |
|
|
|
|
|
|
|
private void loadCommitters(Repository repo) throws IOException { |
|
|
@@ -358,20 +358,6 @@ public class IpLogGenerator { |
|
|
|
String subj = commit.getShortMessage(); |
|
|
|
SingleContribution item = new SingleContribution(id, when, subj); |
|
|
|
|
|
|
|
List<String> bugs = commit.getFooterLines(BUG); |
|
|
|
if (1 == bugs.size()) { |
|
|
|
item.setBugID(bugs.get(0)); |
|
|
|
|
|
|
|
} else if (2 <= bugs.size()) { |
|
|
|
StringBuilder tmp = new StringBuilder(); |
|
|
|
for (String bug : bugs) { |
|
|
|
if (tmp.length() > 0) |
|
|
|
tmp.append(","); |
|
|
|
tmp.append(bug); |
|
|
|
} |
|
|
|
item.setBugID(tmp.toString()); |
|
|
|
} |
|
|
|
|
|
|
|
if (2 <= cnt) { |
|
|
|
item.setSize("(merge)"); |
|
|
|
contributor.add(item); |
|
|
@@ -594,20 +580,15 @@ public class IpLogGenerator { |
|
|
|
} |
|
|
|
|
|
|
|
private Element createContribution(SingleContribution s) { |
|
|
|
Element r = createElement("bug"); |
|
|
|
Element r = createElement("contribution"); |
|
|
|
required(r, "id", s.getID()); |
|
|
|
optional(r, "bug-id", s.getBugID()); |
|
|
|
required(r, "description", s.getSummary()); |
|
|
|
required(r, "size", s.getSize()); |
|
|
|
required(r, "type", "A"); // assume attachment type |
|
|
|
required(r, "created", format(s.getCreated())); |
|
|
|
required(r, "summary", s.getSummary()); |
|
|
|
if (reviewUrl != null) |
|
|
|
optional(r, "url", reviewUrl + s.getID()); |
|
|
|
return r; |
|
|
|
} |
|
|
|
|
|
|
|
private String format(Date created) { |
|
|
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(created); |
|
|
|
} |
|
|
|
|
|
|
|
private Element createElement(String name) { |
|
|
|
return doc.createElementNS(IPLOG_NS, IPLOG_PFX + name); |
|
|
|
} |