From 5aec867b2fae0ff039d0ca4228ccceadecf316c9 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 14 Jul 2013 12:04:52 -0400
Subject: [PATCH] Added release script template and build.xml adjustments
---
src/main/java/com/gitblit/utils/RefLogUtils.java | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/RefLogUtils.java b/src/main/java/com/gitblit/utils/RefLogUtils.java
index ce03a16..643fbc0 100644
--- a/src/main/java/com/gitblit/utils/RefLogUtils.java
+++ b/src/main/java/com/gitblit/utils/RefLogUtils.java
@@ -184,7 +184,7 @@
PersonIdent ident;
if (UserModel.ANONYMOUS.equals(user)) {
// anonymous push
- ident = new PersonIdent("anonymous", "anonymous");
+ ident = new PersonIdent(user.username + "/" + user.username, user.username);
} else {
// construct real pushing account
ident = new PersonIdent(MessageFormat.format("{0}/{1}", user.getDisplayName(), user.username),
@@ -548,16 +548,21 @@
Map<String, DailyLogEntry> dailydigests = new HashMap<String, DailyLogEntry>();
String linearParent = null;
for (RefModel local : JGitUtils.getLocalBranches(repository, true, -1)) {
+ if (!local.getDate().after(minimumDate)) {
+ // branch not recently updated
+ continue;
+ }
String branch = local.getName();
- List<RevCommit> commits = JGitUtils.getRevLog(repository, branch, minimumDate);
- for (RevCommit commit : commits) {
+ List<RepositoryCommit> commits = CommitCache.instance().getCommits(repositoryName, repository, branch, minimumDate);
+ linearParent = null;
+ for (RepositoryCommit commit : commits) {
if (linearParent != null) {
if (!commit.getName().equals(linearParent)) {
// only follow linear branch commits
continue;
}
}
- Date date = JGitUtils.getCommitDate(commit);
+ Date date = commit.getCommitDate();
String dateStr = df.format(date);
if (!dailydigests.containsKey(dateStr)) {
dailydigests.put(dateStr, new DailyLogEntry(repositoryName, date));
@@ -571,7 +576,7 @@
digest.updateRef(branch, ReceiveCommand.Type.UPDATE, linearParent, commit.getName());
}
- RepositoryCommit repoCommit = digest.addCommit(branch, commit);
+ RepositoryCommit repoCommit = digest.addCommit(commit);
if (repoCommit != null) {
List<RefModel> matchedRefs = allRefs.get(commit.getId());
repoCommit.setRefs(matchedRefs);
@@ -587,7 +592,8 @@
}
RefLogEntry tagEntry = tags.get(dateStr);
tagEntry.updateRef(ref.getName(), ReceiveCommand.Type.CREATE);
- tagEntry.addCommit(ref.getName(), commit);
+ RepositoryCommit rc = repoCommit.clone(ref.getName());
+ tagEntry.addCommit(rc);
} else if (ref.getName().startsWith(Constants.R_PULL)) {
// treat pull requests as special events in the log
if (!pulls.containsKey(dateStr)) {
@@ -597,7 +603,8 @@
}
RefLogEntry pullEntry = pulls.get(dateStr);
pullEntry.updateRef(ref.getName(), ReceiveCommand.Type.CREATE);
- pullEntry.addCommit(ref.getName(), commit);
+ RepositoryCommit rc = repoCommit.clone(ref.getName());
+ pullEntry.addCommit(rc);
}
}
}
--
Gitblit v1.9.1