boolean has(RevFlag flag) { return sourceCommit.has(flag); }
@Override public boolean include(RevWalk walker, RevCommit c) { final boolean remoteKnowsIsCommon = c.has(COMMON); if (c.has(ADVERTISED)) { // Remote advertised this, and we have it, hence common. // Whether or not the remote knows that fact is tested // before we added the flag. If the remote doesn't know // we have to still send them this object. // c.add(COMMON); } return !remoteKnowsIsCommon; }
/** * 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; }
/** * Add a commit if it does not have a flag set yet, then set the flag. * <p> * This method permits the application to test if the commit has the given * flag; if it does not already have the flag than the commit is added to * the queue and the flag is set. This later will prevent the commit from * being added twice. * * @param c * commit to add. * @param queueControl * flag that controls admission to the queue. */ public final void add(RevCommit c, RevFlag queueControl) { if (!c.has(queueControl)) { c.add(queueControl); add(c); } }
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. } }
/** * 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 pushLocalCommit(RevCommit p) throws MissingObjectException, IOException { if (p.has(LOCALLY_SEEN)) return; revWalk.parseHeaders(p); p.add(LOCALLY_SEEN); p.add(COMPLETE); p.carry(COMPLETE); localCommitQueue.add(p); }
/** * Increments the distance of this tag candidate if the given commit * has not been seen already * * @param commit The commit to check */ void incrementDistanceIfExcludes(RevCommit commit) { if (!commit.has(flag)) { distance ++; } } }
private boolean wantSatisfied(RevObject want) throws IOException { if (want.has(SATISFIED)) return true; walk.resetRetain(SAVE); walk.markStart((RevCommit) want); if (oldestTime != 0) walk.setRevFilter(CommitTimeRevFilter.after(oldestTime * 1000L)); for (;;) { final RevCommit c = walk.next(); if (c == null) break; if (c.has(PEER_HAS)) { addCommonBase(c); want.add(SATISFIED); return true; } } return false; }
if (exclude(c)) continue; if (c.has(RevFlag.UNINTERESTING)) { if (baseTrees.size() <= maxBases) baseTrees.add(c.getTree()); boolean putTagTargets = false; for (RevCommit cmit : commits) { if (!cmit.has(added)) { cmit.add(added); addObject(cmit, 0); if (!p.has(added) && !p.has(RevFlag.UNINTERESTING) && !exclude(p)) { p.add(added);
!p.has(DEEPEN_NOT)) { pending.add(p); } else {
queue.add(c); while ((c = queue.next()) != null) { if (c.has(DEEPEN_NOT)) { continue;
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. } }
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. } }
private void pushLocalCommit(final RevCommit p) throws MissingObjectException, IOException { if (p.has(LOCALLY_SEEN)) return; revWalk.parseHeaders(p); p.add(LOCALLY_SEEN); p.add(COMPLETE); p.carry(COMPLETE); localCommitQueue.add(p); }
private void pushLocalCommit(RevCommit p) throws MissingObjectException, IOException { if (p.has(LOCALLY_SEEN)) return; revWalk.parseHeaders(p); p.add(LOCALLY_SEEN); p.add(COMPLETE); p.carry(COMPLETE); localCommitQueue.add(p); }
checking.update(1); if (providedObjects != null // && !c.has(RevFlag.UNINTERESTING) // && !providedObjects.contains(c)) throw new MissingObjectException(c, Constants.TYPE_COMMIT);
@Override protected void show(final RevCommit c) throws Exception { if (c.has(RevFlag.UNINTERESTING)) outw.print('-'); c.getId().copyTo(outbuffer, outw); if (parents) for (int i = 0; i < c.getParentCount(); i++) { outw.print(' '); c.getParent(i).getId().copyTo(outbuffer, outw); } outw.println(); }