本文整理汇总了Java中org.eclipse.jgit.errors.StopWalkException类的典型用法代码示例。如果您正苦于以下问题:Java StopWalkException类的具体用法?Java StopWalkException怎么用?Java StopWalkException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StopWalkException类属于org.eclipse.jgit.errors包,在下文中一共展示了StopWalkException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include (RevWalk walker, RevCommit cmit) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException {
if (monitor.isCanceled()) {
throw StopWalkException.INSTANCE;
}
return true;
}
示例2: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include(final RevWalk walker, final RevCommit cmit)
throws StopWalkException, MissingObjectException,
IncorrectObjectTypeException, IOException {
// Since the walker sorts commits by commit time we can be
// reasonably certain there is nothing remaining worth our
// scanning if this commit is before the point in question.
//
if (cmit.getCommitTime() < when)
throw StopWalkException.INSTANCE;
return true;
}
示例3: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
IncorrectObjectTypeException, IOException {
count++;
if (count > maxCount)
throw StopWalkException.INSTANCE;
return true;
}
示例4: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
IncorrectObjectTypeException, IOException {
if (skip > count++)
return false;
return true;
}
示例5: checkout
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
/**
* Points to head commit on master branch
*
* @param repositoryFolder
*/
public void checkout(File repositoryFolder) {
try {
Git git = Git.open(repositoryFolder);
Repository repo = git.getRepository();
CommitFinder finder = new CommitFinder(repo);
CommitCountFilter count = new CommitCountFilter();
finder.setFilter(new AndCommitFilter(new CommitFilter() {
public boolean include(RevWalk walker, RevCommit cmit)
throws IOException {
throw StopWalkException.INSTANCE;
}
public RevFilter clone() {
return this;
}
}, count));
finder.find();
System.out.println(count.getCount());
} catch (IOException e) {
e.printStackTrace();
}
}
示例6: next
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
try {
for (;;) {
final RevCommit c = pending.next();
if (c == null) {
return null;
}
final boolean produce;
if ((c.flags & UNINTERESTING) != 0)
produce = false;
else {
if (filter.requiresCommitBody())
c.parseBody(walker);
produce = filter.include(walker, c);
}
for (final RevCommit p : c.parents) {
if ((p.flags & SEEN) != 0)
continue;
if ((p.flags & PARSED) == 0)
p.parseHeaders(walker);
p.flags |= SEEN;
pending.add(p);
}
walker.carryFlagsImpl(c);
if ((c.flags & UNINTERESTING) != 0) {
if (pending.everbodyHasFlag(UNINTERESTING)) {
final RevCommit n = pending.peek();
if (n != null && n.commitTime >= last.commitTime) {
// This is too close to call. The next commit we
// would pop is dated after the last one produced.
// We have to keep going to ensure that we carry
// flags as much as necessary.
//
overScan = OVER_SCAN;
} else if (--overScan == 0)
throw StopWalkException.INSTANCE;
} else {
overScan = OVER_SCAN;
}
if (canDispose)
c.disposeBody();
continue;
}
if (produce)
return last = c;
else if (canDispose)
c.disposeBody();
}
} catch (StopWalkException swe) {
pending.clear();
return null;
}
}
示例7: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException {
return cmit.getName().equals(revisionCommitName);
}
示例8: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
@Override
public boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
IncorrectObjectTypeException, IOException {
return commitSelection.accept(cmit);
}
示例9: include
import org.eclipse.jgit.errors.StopWalkException; //导入依赖的package包/类
/**
* Determine if the supplied commit should be included in results.
*
* @param walker
* the active walker this filter is being invoked from within.
* @param cmit
* the commit currently being tested. The commit has been parsed
* and its body is available for inspection only if the filter
* returns true from {@link #requiresCommitBody()}.
* @return true to include this commit in the results; false to have this
* commit be omitted entirely from the results.
* @throws StopWalkException
* the filter knows for certain that no additional commits can
* ever match, and the current commit doesn't match either. The
* walk is halted and no more results are provided.
* @throws MissingObjectException
* an object the filter needs to consult to determine its answer
* does not exist in the Git repository the walker is operating
* on. Filtering this commit is impossible without the object.
* @throws IncorrectObjectTypeException
* an object the filter needed to consult was not of the
* expected object type. This usually indicates a corrupt
* repository, as an object link is referencing the wrong type.
* @throws IOException
* a loose object or pack file could not be read to obtain data
* necessary for the filter to make its decision.
*/
public abstract boolean include(RevWalk walker, RevCommit cmit)
throws StopWalkException, MissingObjectException,
IncorrectObjectTypeException, IOException;