C# Class GitSharp.Core.RevWalk.ObjectWalk

Specialized subclass of RevWalk to include trees, blobs and tags. Unlike RevWalk this subclass is able to remember starting roots that include annotated tags, or arbitrary trees or blobs. Once commit generation is complete and all commits have been popped by the application, individual annotated tag, tree and blob objects can be popped through the additional method nextObject. Tree and blob objects reachable from interesting commits are automatically scheduled for inclusion in the results of nextObject, returning each object exactly once. Objects are sorted and returned according to the the commits that reference them and the order they appear within a tree. Ordering can be affected by changing the RevSort used to order the commits that are returned first.
Inheritance: RevWalk
Datei anzeigen Open project: stschake/GitSharp Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
ObjectWalk ( Repository repo ) : System

Create a new revision and object walker for a given repository.

checkConnectivity ( ) : void

Verify all interesting objects are available, and reachable. Callers should populate starting points and ending points with markStart(RevObject) and markUninteresting(RevObject) and then use this method to verify all objects between those two points exist in the repository and are readable. This method returns successfully if everything is connected; it throws an exception if there is a connectivity problem. The exception message provides some detail about the connectivity failure.

markStart ( RevObject o ) : void

Mark an object or commit to start graph traversal from. Callers are encouraged to use RevWalk.parseAny(AnyObjectId) instead of RevWalk.lookupAny(AnyObjectId, int), as this method requires the object to be parsed before it can be added as a root for the traversal. The method will automatically parse an unparsed object, but error handling may be more difficult for the application to explain why a RevObject is not actually valid. The object pool of this walker would also be 'poisoned' by the invalid RevObject. This method will automatically call RevWalk.markStart(RevCommit) if passed RevCommit instance, or a RevTag that directly (or indirectly) references a RevCommit.

markUninteresting ( RevObject o ) : void

Mark an object to not produce in the output. Uninteresting objects denote not just themselves but also their entire reachable chain, back until the merge base of an uninteresting commit and an otherwise interesting commit. Callers are encouraged to use RevWalk.parseAny(AnyObjectId) instead of RevWalk.lookupAny(AnyObjectId, int), as this method requires the object to be parsed before it can be added as a root for the traversal. The method will automatically parse an unparsed object, but error handling may be more difficult for the application to explain why a RevObject is not actually valid. The object pool of this walker would also be 'poisoned' by the invalid RevObject. This method will automatically call RevWalk.markStart(RevCommit) if passed RevCommit instance, or a RevTag that directly (or indirectly) references a RevCommit.

next ( ) : RevCommit
nextObject ( ) : RevObject

Pop the next most recent object.

Private Methods

Method Description
AddObject ( RevObject obj ) : void
MarkTreeUninteresting ( RevObject tree ) : void
ShouldSkipObject ( RevObject o ) : bool
reset ( int retainFlags ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

ObjectWalk() public method

Create a new revision and object walker for a given repository.
public ObjectWalk ( Repository repo ) : System
repo Repository /// The repository the walker will obtain data from. ///
return System

checkConnectivity() public method

Verify all interesting objects are available, and reachable. Callers should populate starting points and ending points with markStart(RevObject) and markUninteresting(RevObject) and then use this method to verify all objects between those two points exist in the repository and are readable. This method returns successfully if everything is connected; it throws an exception if there is a connectivity problem. The exception message provides some detail about the connectivity failure.
/// One or or more of the next objects are not available from the /// object database, but were thought to be candidates for /// traversal. This usually indicates a broken link. /// /// One or or more of the objects in a tree do not match the type /// indicated. /// /// A pack file or loose object could not be Read. ///
public checkConnectivity ( ) : void
return void

markStart() public method

Mark an object or commit to start graph traversal from. Callers are encouraged to use RevWalk.parseAny(AnyObjectId) instead of RevWalk.lookupAny(AnyObjectId, int), as this method requires the object to be parsed before it can be added as a root for the traversal. The method will automatically parse an unparsed object, but error handling may be more difficult for the application to explain why a RevObject is not actually valid. The object pool of this walker would also be 'poisoned' by the invalid RevObject. This method will automatically call RevWalk.markStart(RevCommit) if passed RevCommit instance, or a RevTag that directly (or indirectly) references a RevCommit.
/// The object supplied is not available from the object /// database. This usually indicates the supplied object is /// invalid, but the reference was constructed during an earlier /// invocation to . /// /// The object was not parsed yet and it was discovered during /// parsing that it is not actually the type of the instance /// passed in. This usually indicates the caller used the wrong /// type in a call. /// /// A pack file or loose object could not be Read. ///
public markStart ( RevObject o ) : void
o RevObject /// The object to start traversing from. The object passed must be /// from this same revision walker. ///
return void

markUninteresting() public method

Mark an object to not produce in the output. Uninteresting objects denote not just themselves but also their entire reachable chain, back until the merge base of an uninteresting commit and an otherwise interesting commit. Callers are encouraged to use RevWalk.parseAny(AnyObjectId) instead of RevWalk.lookupAny(AnyObjectId, int), as this method requires the object to be parsed before it can be added as a root for the traversal. The method will automatically parse an unparsed object, but error handling may be more difficult for the application to explain why a RevObject is not actually valid. The object pool of this walker would also be 'poisoned' by the invalid RevObject. This method will automatically call RevWalk.markStart(RevCommit) if passed RevCommit instance, or a RevTag that directly (or indirectly) references a RevCommit.
/// The object supplied is not available from the object /// database. This usually indicates the supplied object is /// invalid, but the reference was constructed during an earlier /// invocation to . /// /// The object was not parsed yet and it was discovered during /// parsing that it is not actually the type of the instance /// passed in. This usually indicates the caller used the wrong /// type in a call. /// /// A pack file or loose object could not be Read. ///
public markUninteresting ( RevObject o ) : void
o RevObject /// The object to start traversing from. The object passed must be /// from this same revision walker. ///
return void

next() public method

public next ( ) : RevCommit
return RevCommit

nextObject() public method

Pop the next most recent object.
/// One or or more of the next objects are not available from the /// object database, but were thought to be candidates for /// traversal. This usually indicates a broken link. /// /// One or or more of the objects in a tree do not match the type indicated. /// /// A pack file or loose object could not be Read. ///
public nextObject ( ) : RevObject
return RevObject