code: private void resolveToCurrent(List<Delta<E>> deltas)
      {
          int lineOffset = 0;
  
          for (Delta<E> d : deltas) {
              Chunk<E> original = d.getOriginal();
              Chunk<E> revised = d.getRevised();
  
              int pos = original.getPosition() + lineOffset;
              // delete lines
              for (int i = 0; i < original.size(); i++) {
                  int origLine = elementList.remove(pos);
                  currentRevisionContent.remove(pos);
                  if (origLine != -1) {
                      sourceRevisions.set(origLine, currentRevision);
                  }
              }
  
              for (int i = 0; i < revised.size(); i++) {
                  currentRevisionContent.add(pos + i, revised.getLines().get(i));
                  elementList.add(pos + i, -1);
              }
  
              lineOffset += revised.size() - original.size();
          }
      }
docs: Resolve revision of line to current revision based on given previous content.
  
  Thanks to Michael Schierl <schierlm%40gmx.de> for sharing this code on StackOverflow.
  
  @param deltas the delta to apply to current content to move to previous revision.