/** * Remove the given flag from all commits. * <p> * Same as <code>clearFlag(flag, 0, size())</code>, but without the * incremental behavior. * * @param flag * the flag to remove. Applications are responsible for * allocating this flag from the source RevWalk. */ public void clearFlag(RevFlag flag) { clearFlag(flag, 0, size()); }
/** * Find the next commit that has the given flag set. * * @param flag * the flag to test commits against. * @param begin * first commit index to test at. Applications may wish to begin * at 0, to test the first commit in the list. * @return index of the first commit at or after index <code>begin</code> * that has the specified flag set on it; -1 if no match is found. */ public int indexOf(RevFlag flag, int begin) { while (begin < size()) { int index = begin; Block s = contents; while (s.shift > 0) { final int i = index >> s.shift; index -= i << s.shift; s = (Block) s.contents[i]; } while (begin++ < size() && index < BLOCK_SIZE) { final RevCommit c = (RevCommit) s.contents[index++]; if (c.has(flag)) return begin; } } return -1; }
private void parseReachable(ObjectId id) { try { RevCommit o = walk.parseCommit(id); if (!o.has(REACHABLE)) { o.add(REACHABLE); reachableCommits.add(o); } } catch (IOException readError) { // If we cannot read the value of the ref skip it. } }
/** * Remove the given flag from all commits. * <p> * This method is actually implemented in terms of: * <code>applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd)</code>. * * @param flag * the flag to remove. Applications are responsible for * allocating this flag from the source RevWalk. * @param rangeBegin * first commit within the list to begin testing at, inclusive. * Must not be negative, but may be beyond the end of the list. * @param rangeEnd * last commit within the list to end testing at, exclusive. If * smaller than or equal to <code>rangeBegin</code> then no * commits will be tested. */ public void clearFlag(final RevFlag flag, final int rangeBegin, final int rangeEnd) { try { applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd); } catch (IOException e) { // Never happen. The filter we use does not throw any // exceptions, for any reason. } }
/** {@inheritDoc} */ @Override public void source(RevWalk w) { if (!(w instanceof PlotWalk)) throw new ClassCastException(MessageFormat.format(JGitText.get().classCastNotA, PlotWalk.class.getName())); super.source(w); }
/** {@inheritDoc} */ @Override public void clear() { super.clear(); positionsAllocated = 0; freePositions.clear(); activeLanes.clear(); laneLength.clear(); }
reachableCommits = new RevCommitList<>(); REACHABLE = walk.newFlag("REACHABLE"); //$NON-NLS-1$ COMMON = walk.newFlag("COMMON"); //$NON-NLS-1$
/** * Find the next commit that has the given flag set. * * @param flag * the flag to test commits against. * @param begin * first commit index to test at. Applications may wish to begin * at <code>size()-1</code>, to test the last commit in the * list. * @return index of the first commit at or before index <code>begin</code> * that has the specified flag set on it; -1 if no match is found. */ public int lastIndexOf(RevFlag flag, int begin) { begin = Math.min(begin, size() - 1); while (begin >= 0) { int index = begin; Block s = contents; while (s.shift > 0) { final int i = index >> s.shift; index -= i << s.shift; s = (Block) s.contents[i]; } while (begin-- >= 0 && index >= 0) { final RevCommit c = (RevCommit) s.contents[index--]; if (c.has(flag)) return begin; } } return -1; }
reachableCommits.add(c);
/** * Remove the given flag from all commits. * <p> * This method is actually implemented in terms of: * <code>applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd)</code>. * * @param flag * the flag to remove. Applications are responsible for * allocating this flag from the source RevWalk. * @param rangeBegin * first commit within the list to begin testing at, inclusive. * Must not be negative, but may be beyond the end of the list. * @param rangeEnd * last commit within the list to end testing at, exclusive. If * smaller than or equal to <code>rangeBegin</code> then no * commits will be tested. */ public void clearFlag(final RevFlag flag, final int rangeBegin, final int rangeEnd) { try { applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd); } catch (IOException e) { // Never happen. The filter we use does not throw any // exceptions, for any reason. } }
@Override public void source(final RevWalk w) { if (!(w instanceof PlotWalk)) throw new ClassCastException(MessageFormat.format(JGitText.get().classCastNotA, PlotWalk.class.getName())); super.source(w); }
@Override public void clear() { super.clear(); positionsAllocated = 0; freePositions.clear(); activeLanes.clear(); laneLength.clear(); }
reachableCommits = new RevCommitList<RevCommit>(); REACHABLE = walk.newFlag("REACHABLE"); //$NON-NLS-1$ COMMON = walk.newFlag("COMMON"); //$NON-NLS-1$
/** * Remove the given flag from all commits. * <p> * Same as <code>clearFlag(flag, 0, size())</code>, but without the * incremental behavior. * * @param flag * the flag to remove. Applications are responsible for * allocating this flag from the source RevWalk. */ public void clearFlag(final RevFlag flag) { clearFlag(flag, 0, size()); }
IncorrectObjectTypeException, IOException { final RevWalk w = flag.getRevWalk(); rangeEnd = Math.min(rangeEnd, size()); while (rangeBegin < rangeEnd) { int index = rangeBegin;
private void parseReachable(ObjectId id) { try { RevCommit o = walk.parseCommit(id); if (!o.has(REACHABLE)) { o.add(REACHABLE); reachableCommits.add(o); } } catch (IOException readError) { // If we cannot read the value of the ref skip it. } }