From 031bae342d0bede7abcf0a9c40acedd7af7ef50a Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 25 Apr 2008 02:45:43 -0400 Subject: [PATCH] Add a collection of starting RevCommits to a RevWalk This is a handy loop in when the application already has a list of interesting commits. Signed-off-by: Shawn O. Pearce --- .../src/org/spearce/jgit/revwalk/RevWalk.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java index e446c692..f6376b6e 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java +++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java @@ -220,6 +220,32 @@ public class RevWalk implements Iterable { } /** + * Mark commits to start graph traversal from. + * + * @param list + * commits to start traversing from. The commits passed must be + * from this same revision walker. + * @throws MissingObjectException + * one of the commits supplied is not available from the object + * database. This usually indicates the supplied commit is + * invalid, but the reference was constructed during an earlier + * invocation to {@link #lookupCommit(AnyObjectId)}. + * @throws IncorrectObjectTypeException + * the object was not parsed yet and it was discovered during + * parsing that it is not actually a commit. This usually + * indicates the caller supplied a non-commit SHA-1 to + * {@link #lookupCommit(AnyObjectId)}. + * @throws IOException + * a pack file or loose object could not be read. + */ + public void markStart(final Collection list) + throws MissingObjectException, IncorrectObjectTypeException, + IOException { + for (final RevCommit c : list) + markStart(c); + } + + /** * Mark a commit to not produce in the output. *

* Uninteresting commits denote not just themselves but also their entire -- 2.11.4.GIT