Example #1
0
  @Override
  public int compareTo(Commit o) {
    if (o.equals(this)) return 0;

    if (findInPredecessors(o)) return 1;

    if (findInSuccessors(o)) return -1;

    return time.compareTo(o.getTime());
  }
Example #2
0
 private boolean findInPredecessors(Commit o) {
   if (this.predecessor.contains(o)) return true;
   for (Commit c : predecessor) if (c.findInPredecessors(o)) return true;
   return false;
 }
Example #3
0
 private boolean findInSuccessors(Commit o) {
   if (this.successors.contains(o)) return true;
   for (Commit c : successors) if (c.findInSuccessors(o)) return true;
   return false;
 }