From bd8ec510a1c1d8ae474bceee7837311f9de05bdb Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 27 Jun 2013 09:26:35 -0400
Subject: [PATCH] Improve RPC documentation

---
 src/main/java/com/gitblit/models/DailyLogEntry.java |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/gitblit/models/DailyLogEntry.java b/src/main/java/com/gitblit/models/DailyLogEntry.java
index db60526..41f1381 100644
--- a/src/main/java/com/gitblit/models/DailyLogEntry.java
+++ b/src/main/java/com/gitblit/models/DailyLogEntry.java
@@ -19,6 +19,7 @@
 import java.util.Date;
 
 import org.eclipse.jgit.lib.PersonIdent;
+import org.eclipse.jgit.transport.ReceiveCommand;
 
 /**
  * Model class to simulate a push for presentation in the push log news feed
@@ -27,7 +28,7 @@
  * 
  * @author James Moger
  */
-public class DailyLogEntry extends PushLogEntry implements Serializable {
+public class DailyLogEntry extends RefLogEntry implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 
@@ -56,4 +57,25 @@
 		
 		return super.getAuthorIdent();
 	}
+	
+	/**
+	 * Tracks the change type for the specified ref.
+	 * 
+	 * @param ref
+	 * @param type
+	 * @param oldId
+	 * @param newId
+	 */
+	public void updateRef(String ref, ReceiveCommand.Type type, String oldId, String newId) {
+		// daily digests are filled from most recent to oldest 
+		String preservedNewId = getNewId(ref);
+		if (preservedNewId == null) {
+			// no preserved new id, this is newest commit
+			// for this ref
+			preservedNewId = newId;
+		}
+		refUpdates.put(ref, type);
+		refIdChanges.put(ref, oldId + "-" + preservedNewId);
+	}
+
 }

--
Gitblit v1.9.1