In FSFS, when recreating a fulltext, instead of combining all deltas, apply one delta against a fulltext or the empty stream and combine the rest.
In FSFS, when recreating a fulltext, instead of combining all deltas, apply
one delta against a fulltext or the empty stream and combine the rest.

This avoids a lot of quadratic behaviour in the delta combiner, especially when
xdelta was used to create the stored deltas.  Since vdelta is still used
for deltas against the empty stream, the first delta will still trigger
the bad behaviour of the combiner without this change.  ghudson suggested
this way of avoiding the slowdown and reviewed.  Daniel Berlin
<dberlin@dberling.org> confirmed my timings.

* subversion/libsvn_fs_fs/fs_fs.c: Include assert.h.
  (read_window): New.
  (get_combined_window): Don't combine with the last window in the rep list.
  Factor out the skipping and reading of a delta window to read_window.
  (get_contents): Apply the last delta in the rep list directly to the source
  plaintext or empty stream.  Allocate the buffers using apr_palloc instead of
  apr_pcalloc.

jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion