DESCRIPTION

Introduce internal API to integrate Team merging.

Team provides a number of APIs to provide access to merge,
comparison and synchronization features. This introduces a
git-specific Subscriber implementation that can retrieve
information from three different sources, along with
implementations to use the index or a TreeWalk to populate
these three 'sources'.

JGit-Dependency: I722352e619794988791c452545d57b17dada407a
Change-Id: Ieda23bb556d342f421f03b93c7faa160998598aa
Also-by: Gustavo Green xxx@xxx.xxx
Also-by: Karter Mora xxx@xxx.xxx
Signed-off-by: Maleah Marks xxx@xxx.xxx
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2015-04-01 14:25:42.000000000

Uploaded patch set 10.

-------------------------------------
author: Brenden Conley
date: 2015-04-01 14:25:49.000000000

Patch Set 10:

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

-------------------------------------
author: Brenden Conley
date: 2015-04-01 14:26:44.000000000

Patch Set 10: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/6918/ : FAILURE

-------------------------------------
author: Douglas Trujillo
date: 2015-04-01 14:36:45.000000000

Patch Set 10: Code-Review+1

(3 comments)

- I think you were right and we have to use NameConflictTreeWalk
- simplified TreeWalkResourceVariantTreeProvider()
- use index constants made public in JGit change https://git.eclipse.org/r/#/c/44961/ this breaks the build until this jgit change is submitted
- minor formatting changes
- I'll now file a CQ for this change to get the IP review done (contribution is >1000 lines)

Line:284, org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java -> after reading NameConflictTreeWalk's javadoc in detail I think you were right to use it, otherwise we may fail to detect name conflicts

Line:67, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> no need to pass constant indexes here

https://git.eclipse.org/r/#/c/44961/  will allow us to use index constants defined in TreeWalk

Line:120, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> this still looks fishy to me, but I didn't yet find a solution which doesn't break the tests, will ask Chris to have a look next week when he's back from vacation

-------------------------------------
author: Maleah Marks
date: 2015-04-01 14:49:01.000000000

Patch Set 10: Code-Review+1

(3 comments)

It looks fine to me!

Line:284, org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java -> I agrree too.

Line:67, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> I agree here, the API is much cleaner without the 3 indexes :)

Line:120, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> I wonder if what we need here is some kind of clone() on TreeWalk and its subclasses?
It'd allow us to iterate a copy of the given treewalk without side-effects and no reset would be needed.

-------------------------------------
author: Douglas Trujillo
date: 2015-04-01 15:02:54.000000000

Patch Set 10:

(1 comment)

Line:120, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> I guess we rather lack some initialization in the code reusing this TreeWalk after it has been reset

-------------------------------------
author: Douglas Trujillo
date: 2015-04-01 22:06:52.000000000

Patch Set 10:

- filed CQ https://dev.eclipse.org/ipzilla/show_bug.cgi?id=9453 for IP review since this change is > 1000 lines

-------------------------------------
author: Maleah Marks
date: 2015-04-02 13:35:49.000000000

Patch Set 10:

(1 comment)

Line:120, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java -> Now that the TreeFilter.ANY_DIFF filter is used, it's impossible to iterate twice on the received TreeWalk: resetting the trees is not sufficient, because the DirCacheBuildIterator will try to add to the index files that have been already added to the DirCache.

The exception that occurs then is: "Duplicate stages not allowed: 0 <file name>".

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