DESCRIPTION

Fixes obtaining common ancestor in Synchronize view

For obtaining common base ancestor I've used suggested RevWalk with
RevFilter.MERGE_BASE. For API compatibility it is also used for
obtaining remote variant.

This patch also improves GitResourceVariant implementation. I replaced
all dependencies to deprecated TreeEntry with proper RevObject
implementation. This have also requires to update test cases.

Bug: 317934
Change-Id: I8f5352862d01e5a5475a74f222241970cd7960ee
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Leslie Stephenson
date: 2010-07-16 15:52:58.000000000

Uploaded patch set 4.

-------------------------------------
author: Carlie Harper
date: 2010-07-20 11:26:03.000000000

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

(6 inline comments)

The test cases fail due to unclosed streams, see comments.

There is a general problem if you synchronize from a source which is not the checked-out branch. I tried it and got conflicts where no conflict should be because the coding always uses the workspace version of the resource as source version.

In my opinion we should always use the local workspace version as source version. This is also what the eclipse synchronize framework assumes. So you could simplify the SelectSynchronizeResourceDialog and just offer a destination selection.

I think we should not use the HEAD, but the workspace version as source. If the resources are dirty or staged we should just mark that by displaying a label decoration in the synchronize view.

Line:62, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariant.java -> This is displayed in the compare editor. I think the blobId does not make sense here. A user does not know what to do woth that. I would like to see the commit id. The commit Id is also diplayed elsewhere in the UI. 

This would still adhere to the javadoc: Return a content identifier that is used to differentiate versions or revisions of the *same* resource.

Line:110, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java -> What's the difference here between shouldIncludeLocal() and not?

I would suggest that we always use the workspace version as source. See also my general comments.

Line:265, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> This input stream is never closed. This even leads to test errors because the project cannot be deleted in tearDown,

Line:309, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> This input stream is never closed. This even leads to test errors because the project cannot be deleted in tearDown,

Line:196, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> This input stream is never closed. This even leads to test errors because the project cannot be deleted in tearDown,

Line:238, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> This input stream is also never closed.

-------------------------------------
author: Leslie Stephenson
date: 2010-07-20 17:53:26.000000000

Patch Set 4: (6 inline comments)

Indeed unclosed streams was an issues in GitResourceVariantTreeTest, but they didn't cause failures in GitResourceVariantTreeSubscriberTest. This problem still exists.

I know about issue with synchronization when source branch isn't same as actually check-outed. But (as I write in comment) I'll prefer to fix it (or make a workaround for it) as a separate commit. *Maybe* when we will be integrated with Logical Model this issue can be solved properly.

Line:62, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariant.java -> I'll prefer to make such change in separate patch, since this one is quite big and it would be easier to track such changes.

Line:110, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java -> Indeed, I didn't spot that earlier, this is same code. But IMHO this should be made by separate patch ;)

Line:265, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> Done

Line:309, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> Done

Line:196, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> This is not the case why GitResourceVariantTreeSubscriberTest fails, but of course it is an issue that needs to be fixed

Done

Line:238, org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java -> Done

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