DESCRIPTION

GitFileHistory should return the full history of its target.

When using GitFileHistoryProvider.getFileHistoryFor(IResource,...), a
user expects the full history of the target resource to be returned,
except if the SINGLE_REVISION or SINGLE_LINE_OF_DESCENT flags are
positioned.

The SINGLE_REVISION flag is properly handled, however when no flags are
set, EGit previously returned only the commits descending from HEAD,
without considering the history that exists on other branches or
references.

This adds specific tests to make sure of the behavior when either no
flag or the SINGLE_REVISION flag are set.

The history's "getTarget" and "getContributors" were rewritten to allow
for some of Team quirks: when using the synchronize view, Team will use
its own file revisions instead of what was originally fed to it. We thus
need to adapt those revisions to types known to us. A specific test
demonstrating this use case has been added.

Bug: 398982
Change-Id: I67720110a47048fb85074a1cbbcb3d4205618a67


COMMENTS

author: Brenden Conley
date: 2013-04-03 08:58:41.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2013-04-03 09:15:34.000000000

Patch Set 3: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4333/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2013-04-10 06:27:49.000000000

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

(5 inline comments)



Line:132, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> don't call this 'ref', since refs are things like branches or tags in git (pointers to commits or pointers to pointers), instead name it 'c' or 'commit'

Line:149, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> as above don't call this 'ref'

Line:215, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> maybe extraction of IFileRevisions could be factored out for all tests needing that

Line:225, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> shouldn't branch-commit-2 also contribute here ?

Line:322, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> isn't branch-commit2 also a child of master-commit2 with respect to file-2 ?

-------------------------------------
author: Gustavo Green
date: 2013-04-10 08:37:24.000000000

Patch Set 3: (5 inline comments)



Line:132, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> Done

Line:149, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> Done

Line:215, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> Most tests also need a reference to the IFileHistory for their purpose (getContributors, getTarget...). Extracting only the call to getFileRevisions() does not seem to provide much value.

Line:225, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> It should. Thanks for catching that.

Added the assertions for branch-commit-2 contributors.

Line:322, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> Yes: this assertion is above, on line 317.

Though I could also have added a check that history.getTargets(branchFileRevision2) returns no children. Done in the incoming patch set.

-------------------------------------
author: Douglas Trujillo
date: 2013-04-10 22:49:41.000000000

Patch Set 3: (2 inline comments)



Line:215, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> I meant the below for-loop extracting the revisions the test wants to check, but I have no concrete proposal how this could be done in a nice way ;-| so don't bother about this comment

Line:322, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/HistoryTest.java -> ah, I missed that since I compared this test with the previous one and hence expected the check here

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