Tabnine Logo
MergeBaseGenerator
Code IndexAdd Tabnine to your IDE (free)

How to use
MergeBaseGenerator
in
org.eclipse.jgit.revwalk

Best Java code snippets using org.eclipse.jgit.revwalk.MergeBaseGenerator (Showing top 20 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

void init(AbstractRevQueue p) throws IOException {
  try {
    for (;;) {
      final RevCommit c = p.next();
      if (c == null)
        break;
      add(c);
    }
    // Setup the condition used by carryOntoOne to detect a late
    // merge base and produce it on the next round.
    //
    recarryTest = branchMask | POPPED;
    recarryMask = branchMask | POPPED | MERGE_BASE;
    mergeBaseAncestor = walker.allocFlag();
    for (;;) {
      RevCommit c = _next();
      if (c == null) {
        break;
      }
      ret.add(c);
    }
  } finally {
    // Always free the flags immediately. This ensures the flags
    // will be available for reuse when the walk resets.
    //
    walker.freeFlag(branchMask | mergeBaseAncestor);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

private void carryOntoHistoryInnerLoop(RevCommit c, int carry) {
  for (;;) {
    RevCommit[] parents = c.parents;
    if (parents == null || parents.length == 0) {
      break;
    }
    int e = parents.length - 1;
    for (int i = 0; i < e; i++) {
      RevCommit p = parents[i];
      if (carryOntoOne(p, carry) == CONTINUE) {
        // Walking p will be required, buffer p on stack.
        stack = new CarryStack(stack, p, carry);
      }
      // For other results from carryOntoOne:
      // HAVE_ALL: p has all bits, do nothing to skip that path.
      // CONTINUE_ON_STACK: callee pushed StackElement for p.
    }
    c = parents[e];
    if (carryOntoOne(c, carry) != CONTINUE) {
      break;
    }
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

private void carryOntoHistory(RevCommit c, int carry) {
  stack = null;
  for (;;) {
    carryOntoHistoryInnerLoop(c, carry);
    if (stack == null) {
      break;
    }
    c = stack.c;
    carry = stack.carry;
    stack = stack.prev;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

      JGitText.get().cannotCombineTreeFilterWithRevFilter, tf, rf));
final MergeBaseGenerator mbg = new MergeBaseGenerator(w);
walker.pending = mbg;
walker.queue = AbstractRevQueue.EMPTY_QUEUE;
mbg.init(q);
return mbg.next();
origin: sonia.jgit/org.eclipse.jgit

private void carryOntoHistory(RevCommit c, final int carry) {
  for (;;) {
    final RevCommit[] pList = c.parents;
    if (pList == null)
      return;
    final int n = pList.length;
    if (n == 0)
      return;
    for (int i = 1; i < n; i++) {
      final RevCommit p = pList[i];
      if (!carryOntoOne(p, carry))
        carryOntoHistory(p, carry);
    }
    c = pList[0];
    if (carryOntoOne(c, carry))
      break;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

carryOntoHistory(c, carry);
origin: sonia.jgit/org.eclipse.jgit

void init(final AbstractRevQueue p) {
  try {
    for (;;) {
      final RevCommit c = p.next();
      if (c == null)
        break;
      add(c);
    }
  } finally {
    // Always free the flags immediately. This ensures the flags
    // will be available for reuse when the walk resets.
    //
    walker.freeFlag(branchMask);
    // Setup the condition used by carryOntoOne to detect a late
    // merge base and produce it on the next round.
    //
    recarryTest = branchMask | POPPED;
    recarryMask = branchMask | POPPED | MERGE_BASE;
  }
}
origin: theonedev/onedev

      JGitText.get().cannotCombineTreeFilterWithRevFilter, tf, rf));
final MergeBaseGenerator mbg = new MergeBaseGenerator(w);
walker.pending = mbg;
walker.queue = AbstractRevQueue.EMPTY_QUEUE;
mbg.init(q);
return mbg.next();
origin: sonia.jgit/org.eclipse.jgit

  private boolean carryOntoOne(final RevCommit p, final int carry) {
    final boolean haveAll = (p.flags & carry) == carry;
    p.flags |= carry;

    if ((p.flags & recarryMask) == recarryTest) {
      // We were popped without being a merge base, but we just got
      // voted to be one. Inject ourselves back at the front of the
      // pending queue and tell all of our ancestors they are within
      // the merge base now.
      //
      p.flags &= ~POPPED;
      pending.add(p);
      carryOntoHistory(p, branchMask | MERGE_BASE);
      return true;
    }

    // If we already had all carried flags, our parents do too.
    // Return true to stop the caller from running down this leg
    // of the revision graph any further.
    //
    return haveAll;
  }
}
origin: berlam/github-bucket

      JGitText.get().cannotCombineTreeFilterWithRevFilter, tf, rf));
final MergeBaseGenerator mbg = new MergeBaseGenerator(w);
walker.pending = mbg;
walker.queue = AbstractRevQueue.EMPTY_QUEUE;
mbg.init(q);
return mbg.next();
origin: theonedev/onedev

void init(AbstractRevQueue p) throws IOException {
  try {
    for (;;) {
      final RevCommit c = p.next();
      if (c == null)
        break;
      add(c);
    }
    // Setup the condition used by carryOntoOne to detect a late
    // merge base and produce it on the next round.
    //
    recarryTest = branchMask | POPPED;
    recarryMask = branchMask | POPPED | MERGE_BASE;
    mergeBaseAncestor = walker.allocFlag();
    for (;;) {
      RevCommit c = _next();
      if (c == null) {
        break;
      }
      ret.add(c);
    }
  } finally {
    // Always free the flags immediately. This ensures the flags
    // will be available for reuse when the walk resets.
    //
    walker.freeFlag(branchMask | mergeBaseAncestor);
  }
}
origin: theonedev/onedev

carryOntoHistory(c, carry);
origin: theonedev/onedev

private void carryOntoHistoryInnerLoop(RevCommit c, int carry) {
  for (;;) {
    RevCommit[] parents = c.parents;
    if (parents == null || parents.length == 0) {
      break;
    }
    int e = parents.length - 1;
    for (int i = 0; i < e; i++) {
      RevCommit p = parents[i];
      if (carryOntoOne(p, carry) == CONTINUE) {
        // Walking p will be required, buffer p on stack.
        stack = new CarryStack(stack, p, carry);
      }
      // For other results from carryOntoOne:
      // HAVE_ALL: p has all bits, do nothing to skip that path.
      // CONTINUE_ON_STACK: callee pushed StackElement for p.
    }
    c = parents[e];
    if (carryOntoOne(c, carry) != CONTINUE) {
      break;
    }
  }
}
origin: theonedev/onedev

private void carryOntoHistory(RevCommit c, int carry) {
  stack = null;
  for (;;) {
    carryOntoHistoryInnerLoop(c, carry);
    if (stack == null) {
      break;
    }
    c = stack.c;
    carry = stack.carry;
    stack = stack.prev;
  }
}
origin: sonia.jgit/org.eclipse.jgit

      JGitText.get().cannotCombineTreeFilterWithRevFilter, tf, rf));
final MergeBaseGenerator mbg = new MergeBaseGenerator(w);
walker.pending = mbg;
walker.queue = AbstractRevQueue.EMPTY_QUEUE;
mbg.init(q);
return mbg.next();
origin: berlam/github-bucket

void init(AbstractRevQueue p) throws IOException {
  try {
    for (;;) {
      final RevCommit c = p.next();
      if (c == null)
        break;
      add(c);
    }
    // Setup the condition used by carryOntoOne to detect a late
    // merge base and produce it on the next round.
    //
    recarryTest = branchMask | POPPED;
    recarryMask = branchMask | POPPED | MERGE_BASE;
    mergeBaseAncestor = walker.allocFlag();
    for (;;) {
      RevCommit c = _next();
      if (c == null) {
        break;
      }
      ret.add(c);
    }
  } finally {
    // Always free the flags immediately. This ensures the flags
    // will be available for reuse when the walk resets.
    //
    walker.freeFlag(branchMask | mergeBaseAncestor);
  }
}
origin: berlam/github-bucket

carryOntoHistory(c, carry);
origin: berlam/github-bucket

private void carryOntoHistoryInnerLoop(RevCommit c, int carry) {
  for (;;) {
    RevCommit[] parents = c.parents;
    if (parents == null || parents.length == 0) {
      break;
    }
    int e = parents.length - 1;
    for (int i = 0; i < e; i++) {
      RevCommit p = parents[i];
      if (carryOntoOne(p, carry) == CONTINUE) {
        // Walking p will be required, buffer p on stack.
        stack = new CarryStack(stack, p, carry);
      }
      // For other results from carryOntoOne:
      // HAVE_ALL: p has all bits, do nothing to skip that path.
      // CONTINUE_ON_STACK: callee pushed StackElement for p.
    }
    c = parents[e];
    if (carryOntoOne(c, carry) != CONTINUE) {
      break;
    }
  }
}
origin: berlam/github-bucket

private void carryOntoHistory(RevCommit c, int carry) {
  stack = null;
  for (;;) {
    carryOntoHistoryInnerLoop(c, carry);
    if (stack == null) {
      break;
    }
    c = stack.c;
    carry = stack.carry;
    stack = stack.prev;
  }
}
origin: sonia.jgit/org.eclipse.jgit

carryOntoHistory(c, carry);
org.eclipse.jgit.revwalkMergeBaseGenerator

Javadoc

Computes the merge base(s) of the starting commits.

This generator is selected if the RevFilter is only org.eclipse.jgit.revwalk.filter.RevFilter#MERGE_BASE.

To compute the merge base we assign a temporary flag to each of the starting commits. The maximum number of starting commits is bounded by the number of free flags available in the RevWalk when the generator is initialized. These flags will be automatically released on the next reset of the RevWalk, but not until then, as they are assigned to commits throughout the history.

Several internal flags are reused here for a different purpose, but this should not have any impact as this generator should be run alone, and without any other generators wrapped around it.

Most used methods

  • <init>
  • add
  • carryOntoHistory
  • carryOntoOne
  • init
  • next
  • _next
  • carryOntoHistoryInnerLoop

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Reference (javax.naming)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • BoxLayout (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now