DESCRIPTION

Proposal: make the staging view use the IndexDiffCache

This makes the staging view no longer use a separat "Staging view
indexer job", but rather uses the already existant (and always updated)
IndexDiffCacheEntry for the selected repository.

This is WIP, especially as i can't get the SWTBot test to behave.
everything works if i click through manually, but when the bot selects
the repository node in the test, the staging view is not notified, and
thus the view is not updated (breaking the test).

all suggestions welcome!

Change-Id: Ia2ed34f57e4639fd086b65ce421dfc7613f93f57


COMMENTS

author: Brenden Conley
date: 2012-03-08 16:06:07.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2012-03-08 16:23:20.000000000

Patch Set 1: I would prefer that you didn't submit this

Build Unstable 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/2599/ : UNSTABLE

-------------------------------------
author: Douglas Trujillo
date: 2012-03-09 06:55:37.000000000

Patch Set 1: Verified; I would prefer that you didn't submit this; IP review completed

(6 inline comments)

Thanks for picking this up :) we wanted to do this since we introduced the index diff cache but unfortunately didn't find the time yet.

On Mac the tests succeed, both when started from Eclipse and also from Maven (tried against Galileo and Indigo). Also on Hudson (running on Linux) tests are fine (the failing synchronize test is unrelated to your change).

We lack some test coverage for the staging view (this is unrelated to your change), so we do not yet test drag&drop and context menu actions.

It seems the refresh button has no effect with your change or do I miss something ?

Line:103, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java -> is this an independent fix ? Why didn't we need this walk before ?

Line:108, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java -> Shouldn't this problem be displayed to the user instead of silently logging an error ? Then the error message needs to be externalized.

style nit: start the error message with an uppercase character

Line:961, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> don't leave dead code

Line:1012, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> don't leave dead code

Line:1116, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> where is the corresponding unregistration ? I would expect we use removeIndexDiffChangedListener() to revert this registration when we don't need to be informed about updates  anymore

Line:1142, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> style nit: missing indentation level

-------------------------------------
author: Bryanna Douglas
date: 2012-03-09 07:17:51.000000000

Patch Set 1: (6 inline comments)

very likely you didn't miss anything. the refresh button does still call reload, which re-gets the diff from the cache - but if all goes well (actually there is not much room for not-going-well :)) it has no effect, as the listeners already updated it to the correct state. shall i remove the refresh button, or leave it as a "emergency button" if something goes out of sync?

new patchset ahead.

Line:103, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java -> the problem is that i cannot ask the IndexDiffData for the mode of a file. this is the quickest fix i found - i'm not really sure whether this is "good" or "correct".

Line:108, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java -> do i have to call another method to display it to the user too? or is externalization enough (i have done it).

Line:961, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:1012, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:1116, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> ah, well - i missed that :)

Line:1142, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> interesting - seems this was the auto-format; i didn't touch this place...

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