|
|
@ -84,10 +84,12 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter; |
|
|
|
* usage of a RevWalk instance to a single thread, or implement their own |
|
|
|
* usage of a RevWalk instance to a single thread, or implement their own |
|
|
|
* synchronization at a higher level. |
|
|
|
* synchronization at a higher level. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* Multiple simultaneous RevWalk instances per {@link Repository} are permitted, |
|
|
|
* Multiple simultaneous RevWalk instances per |
|
|
|
* even from concurrent threads. Equality of {@link RevCommit}s from two |
|
|
|
* {@link org.eclipse.jgit.lib.Repository} are permitted, even from concurrent |
|
|
|
* different RevWalk instances is never true, even if their {@link ObjectId}s |
|
|
|
* threads. Equality of {@link org.eclipse.jgit.revwalk.RevCommit}s from two |
|
|
|
* are equal (and thus they describe the same commit). |
|
|
|
* different RevWalk instances is never true, even if their |
|
|
|
|
|
|
|
* {@link org.eclipse.jgit.lib.ObjectId}s are equal (and thus they describe the |
|
|
|
|
|
|
|
* same commit). |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* The offered iterator is over the list of RevCommits described by the |
|
|
|
* The offered iterator is over the list of RevCommits described by the |
|
|
|
* configuration of this instance. Applications should restrict themselves to |
|
|
|
* configuration of this instance. Applications should restrict themselves to |
|
|
@ -236,12 +238,18 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
this.closeReader = closeReader; |
|
|
|
this.closeReader = closeReader; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @return the reader this walker is using to load objects. */ |
|
|
|
/** |
|
|
|
|
|
|
|
* Get the reader this walker is using to load objects. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return the reader this walker is using to load objects. |
|
|
|
|
|
|
|
*/ |
|
|
|
public ObjectReader getObjectReader() { |
|
|
|
public ObjectReader getObjectReader() { |
|
|
|
return reader; |
|
|
|
return reader; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* {@inheritDoc} |
|
|
|
|
|
|
|
* <p> |
|
|
|
* Release any resources used by this walker's reader. |
|
|
|
* Release any resources used by this walker's reader. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* A walker that has been released can be used again, but may need to be |
|
|
|
* A walker that has been released can be used again, but may need to be |
|
|
@ -272,17 +280,17 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param c |
|
|
|
* @param c |
|
|
|
* the commit to start traversing from. The commit passed must be |
|
|
|
* the commit to start traversing from. The commit passed must be |
|
|
|
* from this same revision walker. |
|
|
|
* from this same revision walker. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the commit supplied is not available from the object |
|
|
|
* the commit supplied is not available from the object |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void markStart(final RevCommit c) throws MissingObjectException, |
|
|
|
public void markStart(final RevCommit c) throws MissingObjectException, |
|
|
@ -302,17 +310,17 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param list |
|
|
|
* @param list |
|
|
|
* commits to start traversing from. The commits passed must be |
|
|
|
* commits to start traversing from. The commits passed must be |
|
|
|
* from this same revision walker. |
|
|
|
* from this same revision walker. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* one of the commits supplied is not available from the object |
|
|
|
* one of the commits supplied is not available from the object |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void markStart(final Collection<RevCommit> list) |
|
|
|
public void markStart(final Collection<RevCommit> list) |
|
|
@ -342,17 +350,17 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param c |
|
|
|
* @param c |
|
|
|
* the commit to start traversing from. The commit passed must be |
|
|
|
* the commit to start traversing from. The commit passed must be |
|
|
|
* from this same revision walker. |
|
|
|
* from this same revision walker. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the commit supplied is not available from the object |
|
|
|
* the commit supplied is not available from the object |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* database. This usually indicates the supplied commit is |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invalid, but the reference was constructed during an earlier |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* invocation to {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* the object was not parsed yet and it was discovered during |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* parsing that it is not actually a commit. This usually |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* indicates the caller supplied a non-commit SHA-1 to |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* {@link #lookupCommit(AnyObjectId)}. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void markUninteresting(final RevCommit c) |
|
|
|
public void markUninteresting(final RevCommit c) |
|
|
@ -383,14 +391,14 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @return true if there is a path directly from <code>tip</code> to |
|
|
|
* @return true if there is a path directly from <code>tip</code> to |
|
|
|
* <code>base</code> (and thus <code>base</code> is fully merged |
|
|
|
* <code>base</code> (and thus <code>base</code> is fully merged |
|
|
|
* into <code>tip</code>); false otherwise. |
|
|
|
* into <code>tip</code>); false otherwise. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* one or or more of the next commit's parents are not available |
|
|
|
* one or or more of the next commit's parents are not available |
|
|
|
* from the object database, but were thought to be candidates |
|
|
|
* from the object database, but were thought to be candidates |
|
|
|
* for traversal. This usually indicates a broken link. |
|
|
|
* for traversal. This usually indicates a broken link. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* one or or more of the next commit's parents are not actually |
|
|
|
* one or or more of the next commit's parents are not actually |
|
|
|
* commit objects. |
|
|
|
* commit objects. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isMergedInto(final RevCommit base, final RevCommit tip) |
|
|
|
public boolean isMergedInto(final RevCommit base, final RevCommit tip) |
|
|
@ -420,14 +428,14 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Pop the next most recent commit. |
|
|
|
* Pop the next most recent commit. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return next most recent commit; null if traversal is over. |
|
|
|
* @return next most recent commit; null if traversal is over. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* one or or more of the next commit's parents are not available |
|
|
|
* one or or more of the next commit's parents are not available |
|
|
|
* from the object database, but were thought to be candidates |
|
|
|
* from the object database, but were thought to be candidates |
|
|
|
* for traversal. This usually indicates a broken link. |
|
|
|
* for traversal. This usually indicates a broken link. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* one or or more of the next commit's parents are not actually |
|
|
|
* one or or more of the next commit's parents are not actually |
|
|
|
* commit objects. |
|
|
|
* commit objects. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevCommit next() throws MissingObjectException, |
|
|
|
public RevCommit next() throws MissingObjectException, |
|
|
@ -439,7 +447,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Obtain the sort types applied to the commits returned. |
|
|
|
* Obtain the sort types applied to the commits returned. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return the sorting strategies employed. At least one strategy is always |
|
|
|
* @return the sorting strategies employed. At least one strategy is always |
|
|
|
* used, but that strategy may be {@link RevSort#NONE}. |
|
|
|
* used, but that strategy may be |
|
|
|
|
|
|
|
* {@link org.eclipse.jgit.revwalk.RevSort#NONE}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public EnumSet<RevSort> getRevSort() { |
|
|
|
public EnumSet<RevSort> getRevSort() { |
|
|
|
return sorting.clone(); |
|
|
|
return sorting.clone(); |
|
|
@ -475,8 +484,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Add or remove a sorting strategy for the returned commits. |
|
|
|
* Add or remove a sorting strategy for the returned commits. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* Multiple strategies can be applied at once, in which case some strategies |
|
|
|
* Multiple strategies can be applied at once, in which case some strategies |
|
|
|
* may take precedence over others. As an example, {@link RevSort#TOPO} must |
|
|
|
* may take precedence over others. As an example, |
|
|
|
* take precedence over {@link RevSort#COMMIT_TIME_DESC}, otherwise it |
|
|
|
* {@link org.eclipse.jgit.revwalk.RevSort#TOPO} must take precedence over |
|
|
|
|
|
|
|
* {@link org.eclipse.jgit.revwalk.RevSort#COMMIT_TIME_DESC}, otherwise it |
|
|
|
* cannot enforce its ordering. |
|
|
|
* cannot enforce its ordering. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param s |
|
|
|
* @param s |
|
|
@ -518,12 +528,14 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Note that filters are not thread-safe and may not be shared by concurrent |
|
|
|
* Note that filters are not thread-safe and may not be shared by concurrent |
|
|
|
* RevWalk instances. Every RevWalk must be supplied its own unique filter, |
|
|
|
* RevWalk instances. Every RevWalk must be supplied its own unique filter, |
|
|
|
* unless the filter implementation specifically states it is (and always |
|
|
|
* unless the filter implementation specifically states it is (and always |
|
|
|
* will be) thread-safe. Callers may use {@link RevFilter#clone()} to create |
|
|
|
* will be) thread-safe. Callers may use |
|
|
|
* a unique filter tree for this RevWalk instance. |
|
|
|
* {@link org.eclipse.jgit.revwalk.filter.RevFilter#clone()} to create a |
|
|
|
|
|
|
|
* unique filter tree for this RevWalk instance. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param newFilter |
|
|
|
* @param newFilter |
|
|
|
* the new filter. If null the special {@link RevFilter#ALL} |
|
|
|
* the new filter. If null the special |
|
|
|
* filter will be used instead, as it matches every commit. |
|
|
|
* {@link org.eclipse.jgit.revwalk.filter.RevFilter#ALL} filter |
|
|
|
|
|
|
|
* will be used instead, as it matches every commit. |
|
|
|
* @see org.eclipse.jgit.revwalk.filter.AndRevFilter |
|
|
|
* @see org.eclipse.jgit.revwalk.filter.AndRevFilter |
|
|
|
* @see org.eclipse.jgit.revwalk.filter.OrRevFilter |
|
|
|
* @see org.eclipse.jgit.revwalk.filter.OrRevFilter |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -536,7 +548,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Get the tree filter used to simplify commits by modified paths. |
|
|
|
* Get the tree filter used to simplify commits by modified paths. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return the current filter. Never null as a filter is always needed. If |
|
|
|
* @return the current filter. Never null as a filter is always needed. If |
|
|
|
* no filter is being applied {@link TreeFilter#ALL} is returned. |
|
|
|
* no filter is being applied |
|
|
|
|
|
|
|
* {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} is |
|
|
|
|
|
|
|
* returned. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public TreeFilter getTreeFilter() { |
|
|
|
public TreeFilter getTreeFilter() { |
|
|
|
return treeFilter; |
|
|
|
return treeFilter; |
|
|
@ -545,20 +559,23 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the tree filter used to simplify commits by modified paths. |
|
|
|
* Set the tree filter used to simplify commits by modified paths. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* If null or {@link TreeFilter#ALL} the path limiter is removed. Commits |
|
|
|
* If null or {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} the |
|
|
|
* will not be simplified. |
|
|
|
* path limiter is removed. Commits will not be simplified. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* If non-null and not {@link TreeFilter#ALL} then the tree filter will be |
|
|
|
* If non-null and not |
|
|
|
* installed. Commits will have their ancestry simplified to hide commits that |
|
|
|
* {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} then the tree |
|
|
|
* do not contain tree entries matched by the filter, unless |
|
|
|
* filter will be installed. Commits will have their ancestry simplified to |
|
|
|
* {@code setRewriteParents(false)} is called. |
|
|
|
* hide commits that do not contain tree entries matched by the filter, |
|
|
|
|
|
|
|
* unless {@code setRewriteParents(false)} is called. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* Usually callers should be inserting a filter graph including |
|
|
|
* Usually callers should be inserting a filter graph including |
|
|
|
* {@link TreeFilter#ANY_DIFF} along with one or more |
|
|
|
* {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ANY_DIFF} along with |
|
|
|
* {@link org.eclipse.jgit.treewalk.filter.PathFilter} instances. |
|
|
|
* one or more {@link org.eclipse.jgit.treewalk.filter.PathFilter} |
|
|
|
|
|
|
|
* instances. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param newFilter |
|
|
|
* @param newFilter |
|
|
|
* new filter. If null the special {@link TreeFilter#ALL} filter |
|
|
|
* new filter. If null the special |
|
|
|
|
|
|
|
* {@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} filter |
|
|
|
* will be used instead, as it matches everything. |
|
|
|
* will be used instead, as it matches everything. |
|
|
|
* @see org.eclipse.jgit.treewalk.filter.PathFilter |
|
|
|
* @see org.eclipse.jgit.treewalk.filter.PathFilter |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -571,9 +588,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Set whether to rewrite parent pointers when filtering by modified paths. |
|
|
|
* Set whether to rewrite parent pointers when filtering by modified paths. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* By default, when {@link #setTreeFilter(TreeFilter)} is called with non- |
|
|
|
* By default, when {@link #setTreeFilter(TreeFilter)} is called with non- |
|
|
|
* null and non-{@link TreeFilter#ALL} filter, commits will have their |
|
|
|
* null and non-{@link org.eclipse.jgit.treewalk.filter.TreeFilter#ALL} |
|
|
|
* ancestry simplified and parents rewritten to hide commits that do not match |
|
|
|
* filter, commits will have their ancestry simplified and parents rewritten |
|
|
|
* the filter. |
|
|
|
* to hide commits that do not match the filter. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* This behavior can be bypassed by passing false to this method. |
|
|
|
* This behavior can be bypassed by passing false to this method. |
|
|
|
* |
|
|
|
* |
|
|
@ -596,8 +613,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* care and would prefer to discard the body of a commit as early as |
|
|
|
* care and would prefer to discard the body of a commit as early as |
|
|
|
* possible, to reduce memory usage. |
|
|
|
* possible, to reduce memory usage. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* True by default on {@link RevWalk} and false by default for |
|
|
|
* True by default on {@link org.eclipse.jgit.revwalk.RevWalk} and false by |
|
|
|
* {@link ObjectWalk}. |
|
|
|
* default for {@link org.eclipse.jgit.revwalk.ObjectWalk}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return true if the body should be retained; false it is discarded. |
|
|
|
* @return true if the body should be retained; false it is discarded. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -608,14 +625,15 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set whether or not the body of a commit or tag is retained. |
|
|
|
* Set whether or not the body of a commit or tag is retained. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* If a body of a commit or tag is not retained, the application must |
|
|
|
* If a body of a commit or tag is not retained, the application must call |
|
|
|
* call {@link #parseBody(RevObject)} before the body can be safely |
|
|
|
* {@link #parseBody(RevObject)} before the body can be safely accessed |
|
|
|
* accessed through the type specific access methods. |
|
|
|
* through the type specific access methods. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* True by default on {@link RevWalk} and false by default for |
|
|
|
* True by default on {@link org.eclipse.jgit.revwalk.RevWalk} and false by |
|
|
|
* {@link ObjectWalk}. |
|
|
|
* default for {@link org.eclipse.jgit.revwalk.ObjectWalk}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param retain true to retain bodies; false to discard them early. |
|
|
|
* @param retain |
|
|
|
|
|
|
|
* true to retain bodies; false to discard them early. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setRetainBody(final boolean retain) { |
|
|
|
public void setRetainBody(final boolean retain) { |
|
|
|
retainBody = retain; |
|
|
|
retainBody = retain; |
|
|
@ -759,11 +777,11 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param id |
|
|
|
* @param id |
|
|
|
* name of the commit object. |
|
|
|
* name of the commit object. |
|
|
|
* @return reference to the commit object. Never null. |
|
|
|
* @return reference to the commit object. Never null. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied commit does not exist. |
|
|
|
* the supplied commit does not exist. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the supplied id is not a commit or an annotated tag. |
|
|
|
* the supplied id is not a commit or an annotated tag. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevCommit parseCommit(final AnyObjectId id) |
|
|
|
public RevCommit parseCommit(final AnyObjectId id) |
|
|
@ -786,11 +804,11 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* name of the tree object, or a commit or annotated tag that may |
|
|
|
* name of the tree object, or a commit or annotated tag that may |
|
|
|
* reference a tree. |
|
|
|
* reference a tree. |
|
|
|
* @return reference to the tree object. Never null. |
|
|
|
* @return reference to the tree object. Never null. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied tree does not exist. |
|
|
|
* the supplied tree does not exist. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the supplied id is not a tree, a commit or an annotated tag. |
|
|
|
* the supplied id is not a tree, a commit or an annotated tag. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevTree parseTree(final AnyObjectId id) |
|
|
|
public RevTree parseTree(final AnyObjectId id) |
|
|
@ -820,11 +838,11 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param id |
|
|
|
* @param id |
|
|
|
* name of the tag object. |
|
|
|
* name of the tag object. |
|
|
|
* @return reference to the tag object. Never null. |
|
|
|
* @return reference to the tag object. Never null. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied tag does not exist. |
|
|
|
* the supplied tag does not exist. |
|
|
|
* @throws IncorrectObjectTypeException |
|
|
|
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException |
|
|
|
* the supplied id is not a tag or an annotated tag. |
|
|
|
* the supplied id is not a tag or an annotated tag. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevTag parseTag(final AnyObjectId id) throws MissingObjectException, |
|
|
|
public RevTag parseTag(final AnyObjectId id) throws MissingObjectException, |
|
|
@ -847,9 +865,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param id |
|
|
|
* @param id |
|
|
|
* name of the object. |
|
|
|
* name of the object. |
|
|
|
* @return reference to the object. Never null. |
|
|
|
* @return reference to the object. Never null. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied does not exist. |
|
|
|
* the supplied does not exist. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevObject parseAny(final AnyObjectId id) |
|
|
|
public RevObject parseAny(final AnyObjectId id) |
|
|
@ -916,8 +934,6 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Asynchronous object parsing. |
|
|
|
* Asynchronous object parsing. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param <T> |
|
|
|
|
|
|
|
* any ObjectId type. |
|
|
|
|
|
|
|
* @param objectIds |
|
|
|
* @param objectIds |
|
|
|
* objects to open from the object store. The supplied collection |
|
|
|
* objects to open from the object store. The supplied collection |
|
|
|
* must not be modified until the queue has finished. |
|
|
|
* must not be modified until the queue has finished. |
|
|
@ -1007,9 +1023,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param obj |
|
|
|
* @param obj |
|
|
|
* the object the caller needs to be parsed. |
|
|
|
* the object the caller needs to be parsed. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied does not exist. |
|
|
|
* the supplied does not exist. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void parseHeaders(final RevObject obj) |
|
|
|
public void parseHeaders(final RevObject obj) |
|
|
@ -1026,9 +1042,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param obj |
|
|
|
* @param obj |
|
|
|
* the object the caller needs to be parsed. |
|
|
|
* the object the caller needs to be parsed. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* the supplied does not exist. |
|
|
|
* the supplied does not exist. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void parseBody(final RevObject obj) |
|
|
|
public void parseBody(final RevObject obj) |
|
|
@ -1044,9 +1060,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @return If {@code obj} is not an annotated tag, {@code obj}. Otherwise |
|
|
|
* @return If {@code obj} is not an annotated tag, {@code obj}. Otherwise |
|
|
|
* the first non-tag object that {@code obj} references. The |
|
|
|
* the first non-tag object that {@code obj} references. The |
|
|
|
* returned object's headers have been parsed. |
|
|
|
* returned object's headers have been parsed. |
|
|
|
* @throws MissingObjectException |
|
|
|
* @throws org.eclipse.jgit.errors.MissingObjectException |
|
|
|
* a referenced object cannot be found. |
|
|
|
* a referenced object cannot be found. |
|
|
|
* @throws IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
* a pack file or loose object could not be read. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevObject peel(RevObject obj) throws MissingObjectException, |
|
|
|
public RevObject peel(RevObject obj) throws MissingObjectException, |
|
|
@ -1069,7 +1085,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* @param name |
|
|
|
* @param name |
|
|
|
* description of the flag, primarily useful for debugging. |
|
|
|
* description of the flag, primarily useful for debugging. |
|
|
|
* @return newly constructed flag instance. |
|
|
|
* @return newly constructed flag instance. |
|
|
|
* @throws IllegalArgumentException |
|
|
|
* @throws java.lang.IllegalArgumentException |
|
|
|
* too many flags have been reserved on this revision walker. |
|
|
|
* too many flags have been reserved on this revision walker. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RevFlag newFlag(final String name) { |
|
|
|
public RevFlag newFlag(final String name) { |
|
|
@ -1308,6 +1324,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* {@inheritDoc} |
|
|
|
|
|
|
|
* <p> |
|
|
|
* Returns an Iterator over the commits of this walker. |
|
|
|
* Returns an Iterator over the commits of this walker. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* The returned iterator is only useful for one walk. If this RevWalk gets |
|
|
|
* The returned iterator is only useful for one walk. If this RevWalk gets |
|
|
@ -1316,10 +1334,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
* Applications must not use both the Iterator and the {@link #next()} API |
|
|
|
* Applications must not use both the Iterator and the {@link #next()} API |
|
|
|
* at the same time. Pick one API and use that for the entire walk. |
|
|
|
* at the same time. Pick one API and use that for the entire walk. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* If a checked exception is thrown during the walk (see {@link #next()}) |
|
|
|
* If a checked exception is thrown during the walk (see {@link #next()}) it |
|
|
|
* it is rethrown from the Iterator as a {@link RevWalkException}. |
|
|
|
* is rethrown from the Iterator as a {@link RevWalkException}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return an iterator over this walker's commits. |
|
|
|
|
|
|
|
* @see RevWalkException |
|
|
|
* @see RevWalkException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1365,7 +1382,9 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Throws an exception if we have started producing output. */ |
|
|
|
/** |
|
|
|
|
|
|
|
* Throws an exception if we have started producing output. |
|
|
|
|
|
|
|
*/ |
|
|
|
protected void assertNotStarted() { |
|
|
|
protected void assertNotStarted() { |
|
|
|
if (isNotStarted()) |
|
|
|
if (isNotStarted()) |
|
|
|
return; |
|
|
|
return; |
|
|
@ -1377,7 +1396,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create and return an {@link ObjectWalk} using the same objects. |
|
|
|
* Create and return an {@link org.eclipse.jgit.revwalk.ObjectWalk} using |
|
|
|
|
|
|
|
* the same objects. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* Prior to using this method, the caller must reset this RevWalk to clean |
|
|
|
* Prior to using this method, the caller must reset this RevWalk to clean |
|
|
|
* any flags that were used during the last traversal. |
|
|
|
* any flags that were used during the last traversal. |
|
|
|