Split get_diff_files into get_diff_files and populate_diff_chunks.

Review Request #3211 — Created July 13, 2012 and submitted

Information

Review Board
release-1.6.x

Reviewers

Split get_diff_files into get_diff_files and populate_diff_chunks.

get_diff_files was set up to run in two possible modes. In one mode, it
just fetched all the files and metadata that would be displayed in a
diff viewer. In the other mode, it would do that and load diff chunks.

Really, there was no reason to do both. It just made things more
complicated. The information loading mode was nothing but database hits,
so we had a certain known level of complexity there. The chunk loading
code, however, was very expensive, and drastically changed what you
would expect time-wise from the function.

Now the chunk loading is done in populate_diff_chunks, which just
iterates through the list of files provided by get_diff_files and loads
the chunks for each.

This is the first step in a series of changes I'm planning to make to
restructure bits of the diff handling code to make it more extensible.
Tested loading diffs and chunks (expanding collapsed regions).

All unit tests pass.
Description From Last Updated

Can't this just be enumerate(chunks)?

daviddavid
SM
  1. Looks good to me.
  2. 
      
david
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revision 1)
     
     
    Can't this just be enumerate(chunks)?
  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.6.x (cd3e2e00)
Loading...