DESCRIPTION

Implement project rename and move for some cases

We can now move and rename projects within a repository for a number
of cases. Moving a project to a subdirectory does not work and since
Eclipse actually destroys the project, we simply forbid it for now
(Platform bug 307140). The bug is only worked around in Eclipse 3.7,
i.e. forbidden in the UI.

This also adds tests for move and delete of folders and files. We are
quite inconsistent with respect to how we handle the index, i.e.
sometime we update the index to reflect the change and sometimes we do
not, so the current behavior may not be the final behavior.

RFC: Moving repositories require disconnect/connect and this is, I think
not reliable yet.

This version of the patch does not try to evade bug 307140

Requires JGit patch: I7425da91c0752ae82484e3c29d21b57402d30c61

Bug: 334112
Bug: 358703
Change-Id: I634d5b44bc7fc6a7453b5d718733c9f8f3542840
Signed-off-by: Juliet Cantu xxx@xxx.xxx


COMMENTS

author: Gerrit Johnathan Pham
date: 2011-08-10 18:42:27.000000000

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.

-------------------------------------
author: Juliet Cantu
date: 2011-10-02 11:10:53.000000000

Uploaded patch set 19.

-------------------------------------
author: Brenden Conley
date: 2011-10-02 11:11:03.000000000

Patch Set 19:

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

-------------------------------------
author: Brenden Conley
date: 2011-10-02 11:20:34.000000000

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

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

-------------------------------------
author: Brenden Conley
date: 2011-10-03 22:26:26.000000000

Patch Set 19: No score

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

-------------------------------------
author: Brenden Conley
date: 2011-10-03 22:38:01.000000000

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

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

-------------------------------------
author: Brenden Conley
date: 2011-10-05 20:01:22.000000000

Patch Set 19: No score

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

-------------------------------------
author: Brenden Conley
date: 2011-10-05 20:13:08.000000000

Patch Set 19: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/1739/ : SUCCESS

-------------------------------------
author: Carlie Harper
date: 2011-11-07 13:16:28.000000000

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

(6 inline comments)

Please see my inline comments.

I think the change is otherwise ready to submit. We should tackle the open issues with another commit:

- Move a project outside of a git repo
- What else?

Line:357, org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java -> In fact the project is not moved. Don't you think that the test method name is misleading?

Line:242, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> The two variables above are only needed in line 257. Please move them just before that line.

Line:244, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> The method moveProject gets really long. Could you extract this and other blocks as methods?

Line:307, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> You test for this scenario: 

newLocation: C:/Eclipse/workspaces/junit-workspace/P2
gitDir: C:/Eclipse/workspaces/junit-workspace/Project-1/.git

The condition would also apply if we moved a project from within a repository to a location below the folder containing the repo: 

newLocation: C:/myfolder/P2
gitDir: C:/myfolder/myrepo/.git
sourceLocation: C:/myfolder/myrepo/Project-1

But moving projects outside of the repo never had worked before, therefore we may ignore this one here.

Line:314, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> Why do we need this here?

Project.move already acquires scheduling rules for the move operation.

Line:21, /COMMIT_MSG -> Why do you think that it is not reliable?

-------------------------------------
author: Juliet Cantu
date: 2011-11-13 19:36:31.000000000

Patch Set 19: (6 inline comments)



Line:357, org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java -> Done

Line:242, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> Done

Line:244, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> Done

Line:307, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> Done. Right, moving in and out of repositories should be handled too. Any takers?

Line:314, org.eclipse.egit.core/src/org/eclipse/egit/core/GitMoveDeleteHook.java -> Done

Line:21, /COMMIT_MSG -> I was thinking of rebuilds and windows. Moving a lot of files in Windows is scary, but then this doesn't change that and hopefully the resource rules protects what can be protected.

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