diff src/org/tmatesoft/hg/repo/HgChangelog.java @ 317:09628675bcee

Rework file history build approach to match rest of the API
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Sep 2011 03:20:28 +0200
parents f9f3e9b67ccc
children a674b8590362
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgChangelog.java	Wed Sep 28 13:09:16 2011 +0200
+++ b/src/org/tmatesoft/hg/repo/HgChangelog.java	Thu Sep 29 03:20:28 2011 +0200
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Formatter;
@@ -38,6 +39,7 @@
 import org.tmatesoft.hg.internal.Pool;
 import org.tmatesoft.hg.internal.RevlogStream;
 import org.tmatesoft.hg.util.CancelSupport;
+import org.tmatesoft.hg.util.Pair;
 import org.tmatesoft.hg.util.ProgressSupport;
 
 /**
@@ -105,6 +107,19 @@
 	}
 
 	/**
+	 * Unlike regular {@link Inspector}, this one supplies changeset revision along with its parents and children according
+	 * to parent information of the revlog this inspector visits.
+	 * @see HgDataFile#history(TreeInspector)
+	 */
+	public interface TreeInspector {
+		// the reason TreeInsector is in HgChangelog, not in Revlog, because despite the fact it can
+		// be applied to any revlog, it's not meant to provide revisions of any revlog it's beeing applied to, 
+		// but changeset revisions always.
+		// TODO HgChangelog.walk(TreeInspector)
+		void next(Nodeid changesetRevision, Pair<Nodeid, Nodeid> parentChangesets, Collection<Nodeid> childChangesets);
+	}
+
+	/**
 	 * Entry in the Changelog
 	 */
 	public static class RawChangeset implements Cloneable /* for those that would like to keep a copy */{