Exemplo n.º 1
0
  public void removeEntriesWithPathForAuthor(String path, String author) {
    if (logEntries == null || logEntries.isEmpty()) {
      return;
    }

    int count = logEntries.size();
    int i = 0;

    while (i < count) {
      LogEntry logEntry = logEntries.get(i);
      if (!logEntry.getAuthor().equals(author)) {
        i++;
        continue;
      }

      logEntry.removeEntriesWithPath(path);
      if (logEntry.isEmpty()) {
        logEntries.remove(logEntry);
        count--;
        continue;
      }

      i++;
    }

    isOrdered = false;
  }
Exemplo n.º 2
0
  public void removeNotLastModifications() {
    List<String> uniquePaths = getUniquePaths();
    for (String path : uniquePaths) {
      int lastRevision = getLastModificationRevisionForPath(path);

      int count = logEntries.size();
      int i = 0;

      while (i < count) {
        LogEntry entry = logEntries.get(i);

        if (entry.getRevision() < lastRevision) {
          entry.removeEntriesWithPath(path);
          if (entry.isEmpty()) {
            logEntries.remove(entry);
            count--;
            i--;
          }
        }

        i++;
      }
    }

    isOrdered = false;
  }
Exemplo n.º 3
0
  public void removeEntriesWithPath(String path) {
    if (logEntries == null || logEntries.isEmpty()) {
      return;
    }

    int count = logEntries.size();
    int i = 0;

    while (i < count) {
      LogEntry logEntry = logEntries.get(i);
      logEntry.removeEntriesWithPath(path);

      if (logEntry.isEmpty()) {
        logEntries.remove(logEntry);
        count--;
        continue;
      }

      i++;
    }

    isOrdered = false;
  }