本文整理汇总了Java中org.eclipse.jgit.treewalk.filter.TreeFilter.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java TreeFilter.ALL属性的具体用法?Java TreeFilter.ALL怎么用?Java TreeFilter.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jgit.treewalk.filter.TreeFilter
的用法示例。
在下文中一共展示了TreeFilter.ALL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RevWalk
private RevWalk(ObjectReader or, boolean closeReader) {
reader = or;
idBuffer = new MutableObjectId();
objects = new ObjectIdOwnerMap<>();
roots = new ArrayList<>();
queue = new DateRevQueue();
pending = new StartGenerator(this);
sorting = EnumSet.of(RevSort.NONE);
filter = RevFilter.ALL;
treeFilter = TreeFilter.ALL;
this.closeReader = closeReader;
}
示例2: isMergedInto
/**
* Determine if a commit is reachable from another commit.
* <p>
* A commit <code>base</code> is an ancestor of <code>tip</code> if we
* can find a path of commits that leads from <code>tip</code> and ends at
* <code>base</code>.
* <p>
* This utility function resets the walker, inserts the two supplied
* commits, and then executes a walk until an answer can be obtained.
* Currently allocated RevFlags that have been added to RevCommit instances
* will be retained through the reset.
*
* @param base
* commit the caller thinks is reachable from <code>tip</code>.
* @param tip
* commit to start iteration from, and which is most likely a
* descendant (child) of <code>base</code>.
* @return true if there is a path directly from <code>tip</code> to
* <code>base</code> (and thus <code>base</code> is fully merged
* into <code>tip</code>); false otherwise.
* @throws MissingObjectException
* one or or more of the next commit's parents are not available
* from the object database, but were thought to be candidates
* for traversal. This usually indicates a broken link.
* @throws IncorrectObjectTypeException
* one or or more of the next commit's parents are not actually
* commit objects.
* @throws IOException
* a pack file or loose object could not be read.
*/
public boolean isMergedInto(final RevCommit base, final RevCommit tip)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {
final RevFilter oldRF = filter;
final TreeFilter oldTF = treeFilter;
try {
finishDelayedFreeFlags();
reset(~freeFlags & APP_FLAGS);
filter = RevFilter.MERGE_BASE;
treeFilter = TreeFilter.ALL;
markStart(tip);
markStart(base);
RevCommit mergeBase;
while ((mergeBase = next()) != null)
if (mergeBase == base)
return true;
return false;
} finally {
filter = oldRF;
treeFilter = oldTF;
}
}
示例3: writeTo
@Override
public final void writeTo(OutputStream out) throws IOException {
DiffFormatter formatter = new DiffFormatter(new BufferedOutputStream(out));
formatter.setRepository(repository);
List<String> rawFileFilter = params.getFileFilter();
TreeFilter pathFilter =
(rawFileFilter != null && rawFileFilter.size() > 0)
? PathFilterGroup.createFromStrings(rawFileFilter)
: TreeFilter.ALL;
formatter.setPathFilter(AndTreeFilter.create(TreeFilter.ANY_DIFF, pathFilter));
try {
String commitA = params.getCommitA();
String commitB = params.getCommitB();
boolean cached = params.isCached();
List<DiffEntry> diff;
if (commitA == null && commitB == null && !cached) {
diff = indexToWorkingTree(formatter);
} else if (commitA != null && commitB == null && !cached) {
diff = commitToWorkingTree(commitA, formatter);
} else if (commitA == null && commitB != null) {
diff = emptyToCommit(commitB, formatter);
} else if (commitB == null) {
diff = commitToIndex(commitA, formatter);
} else {
diff = commitToCommit(commitA, commitB, formatter);
}
DiffType type = params.getType();
if (type == DiffType.NAME_ONLY) {
writeNames(diff, out);
} else if (type == DiffType.NAME_STATUS) {
writeNamesAndStatus(diff, out);
} else {
writeRawDiff(diff, formatter);
}
} catch (GitException e) {
LOG.error(e.getMessage());
} finally {
formatter.close();
repository.close();
}
}
示例4: setTreeFilter
/**
* Set the tree filter used to simplify commits by modified paths.
* <p>
* If null or {@link TreeFilter#ALL} the path limiter is removed. Commits
* will not be simplified.
* <p>
* If non-null and not {@link TreeFilter#ALL} then the tree filter will be
* installed. Commits will have their ancestry simplified to hide commits that
* do not contain tree entries matched by the filter, unless
* {@code setRewriteParents(false)} is called.
* <p>
* Usually callers should be inserting a filter graph including
* {@link TreeFilter#ANY_DIFF} along with one or more
* {@link org.eclipse.jgit.treewalk.filter.PathFilter} instances.
*
* @param newFilter
* new filter. If null the special {@link TreeFilter#ALL} filter
* will be used instead, as it matches everything.
* @see org.eclipse.jgit.treewalk.filter.PathFilter
*/
public void setTreeFilter(final TreeFilter newFilter) {
assertNotStarted();
treeFilter = newFilter != null ? newFilter : TreeFilter.ALL;
}