DESCRIPTION

Fix endless loop of GenerateHistoryJob

The GenerateHistoryJob was scheduled over and over when the following
precondiations were met:

 - The preference "Team > Git > History > Maximum number of commits to 
   show" has to be set to a numer smaller than the number of commits
   in a repository
 - The history of the repository is fully loaded into the History view
 - The user scrolls down to the end

Scrolling triggers the event listener added in the constructor of 
CommitGraphTable (This is done to implement incremental loading).
The event listener calls the method loadItem of GitHistory Page to load
a given commit specified by its index. This method asks the 
GenerateHistoryJob if the commit is less than BATCH_SIZE / 2 away from 
the end, and if so, triggers a new GenerateHistoryJob.

After loading the commits the GenerateHistoryJob wrongly computed the
value of the incomplete variable. It did not check if all commits of 
the history were loaded. Because of that the updateUI method did render
the UI again leading to another call of the event listener above.

This commit adds a check if all commits are loaded. 
This is unfortunately not easily done with the SWTCommitList.

So we check if no new commits were loaded in the current invocation of 
the GenerateHistoryJob and in that case step out of the loop before 
the check for incomplete is done. Then the method updateUI in 
GenerateHistoryJob will not render the UI again and not start the 
endless loop anymore.

But the updateUI method has to render the UI once more after all 
commits are loaded. This is ensured by the new field
forcedRedrawsAfterListIsCompleted.

Bug: 425691
Change-Id: Ice8c59d537156a52acb80c8e004e838e279cdbe3


COMMENTS

author: Brenden Conley
date: 2014-01-21 09:28:22.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/5485/

-------------------------------------
author: Brenden Conley
date: 2014-01-21 09:41:56.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/5485/ : SUCCESS

-------------------------------------
author: Kaeden Tapia
date: 2014-01-21 16:03:54.000000000

Patch Set 1:

Hello Stephan. With this patch, I see a strange behavior: When the "Show Find Toolbar" is enabled (so incremental loading disabled) the number of commits goes over the maximum set in the preferences. It seems it does a few more updates after detecting it's incomplete. I set my maximum to 20 commits to make it more apparent. This does not happen in my updated my patch but I'm not sure why since the approach is similar.

https://git.eclipse.org/r/#/c/20640/

-------------------------------------
