org.gitective.core.filter.commit
Class LastCommitDiffFilter

java.lang.Object
  extended by org.eclipse.jgit.revwalk.filter.RevFilter
      extended by org.gitective.core.filter.commit.CommitFilter
          extended by org.gitective.core.filter.commit.CommitDiffFilter
              extended by org.gitective.core.filter.commit.LastCommitDiffFilter
All Implemented Interfaces:
Cloneable

public class LastCommitDiffFilter
extends CommitDiffFilter

Filter that includes commits until all the tree paths in the first commit visited have been attributed to the last commit that edited each path in the initial tree.

Using this filter starting at the HEAD commit will give you the commit that last modified each file current in the HEAD tree.


Field Summary
 
Fields inherited from class org.gitective.core.filter.commit.CommitDiffFilter
detectRenames, renameDetector
 
Fields inherited from class org.gitective.core.filter.commit.CommitFilter
repository
 
Fields inherited from class org.eclipse.jgit.revwalk.filter.RevFilter
ALL, MERGE_BASE, NO_MERGES, NONE
 
Constructor Summary
LastCommitDiffFilter()
          Create filter
LastCommitDiffFilter(boolean detectRenames)
          Create filter
 
Method Summary
 org.eclipse.jgit.revwalk.filter.RevFilter clone()
          Clones this filter.
 Map<String,org.eclipse.jgit.revwalk.RevCommit> getCommits()
          Get all paths in the tree returned from getTree() mapped to the last commit that modified the path
 org.eclipse.jgit.revwalk.RevTree getTree()
          Get tree being indexed
 boolean include(org.eclipse.jgit.revwalk.RevWalk walker, org.eclipse.jgit.revwalk.RevCommit commit, Collection<org.eclipse.jgit.diff.DiffEntry> diffs)
          Handle the differences introduced by given commit.
 CommitFilter reset()
          Resets the filter state.
 
Methods inherited from class org.gitective.core.filter.commit.CommitDiffFilter
createTreeWalk, include, include, isFileDiff, setRepository
 
Methods inherited from class org.gitective.core.filter.commit.CommitFilter
include, setStop
 
Methods inherited from class org.eclipse.jgit.revwalk.filter.RevFilter
negate, requiresCommitBody, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LastCommitDiffFilter

public LastCommitDiffFilter()
Create filter


LastCommitDiffFilter

public LastCommitDiffFilter(boolean detectRenames)
Create filter

Parameters:
detectRenames -
Method Detail

include

public boolean include(org.eclipse.jgit.revwalk.RevWalk walker,
                       org.eclipse.jgit.revwalk.RevCommit commit,
                       Collection<org.eclipse.jgit.diff.DiffEntry> diffs)
                throws IOException
Description copied from class: CommitDiffFilter
Handle the differences introduced by given commit.

Sub-classes should override this method. The default implementation calls CommitDiffFilter.include(RevCommit, Collection).

Overrides:
include in class CommitDiffFilter
Parameters:
walker - non-null
commit - non-null
diffs - non-null
Returns:
true to continue, false to abort
Throws:
IOException

getTree

public org.eclipse.jgit.revwalk.RevTree getTree()
Get tree being indexed

Returns:
tree

getCommits

public Map<String,org.eclipse.jgit.revwalk.RevCommit> getCommits()
Get all paths in the tree returned from getTree() mapped to the last commit that modified the path

Returns:
commits

reset

public CommitFilter reset()
Description copied from class: CommitFilter
Resets the filter state. The base implementation does nothing by default and sub-classes should override if custom reset logic exists.

Overrides:
reset in class CommitFilter
Returns:
this filter

clone

public org.eclipse.jgit.revwalk.filter.RevFilter clone()
Description copied from class: CommitFilter
Clones this filter.

The default implementation throws a UnsupportedOperationException and sub-classes should override if filter cloning is supported.

Overrides:
clone in class CommitFilter
See Also:
RevFilter.clone()


Copyright © 2011-2012. All Rights Reserved.