DESCRIPTION

Support copy/move of workspace if Git repository is under workspace

If git repositories are located under the workspace path moving or
copying the workspace broke the repository path information in
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs
since all repository paths were stored as absolute paths and paths
of repositories located under the moved or copied workspace weren't
matching this persisted paths anymore.

Fix this by storing the repository path relative to the workspace root
if a repository path is located under the workspace root. For
repositories not located under the workspace root still store the
absolute path since otherwise their path would break if the workspace is
moved or copied. Store this in a new preference and still maintain the
old preference with list of absolute repository paths in order to ensure
compatibility with older EGit versions.

Bug: 358285
Change-Id: Ib73b76eb1d63587a767fec59c076fbe51c75e2f1
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2016-03-07 16:43:27.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2016-03-07 16:43:33.000000000

Patch Set 5:

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

-------------------------------------
author: Alayna Houston
date: 2016-03-07 17:03:47.000000000

Patch Set 5:

> Uploaded patch set 5.

Whoa. You rebased onto https://git.eclipse.org/r/#/c/67701/6 . Not sure that'll help yet with that failing test. My change isn't stable yet either. I didn't properly account for the RepositoryChangeScanner (at least I hope that was the reason why build 8257 was unstable). It may run at the same time as the test for no cached repos, which then will of course fail. See my last comment over there. I'll try to get that fixed tonight, but if I don't make it, we could in the worst case xxx@xxx.xxx that failing test temporarily.

-------------------------------------
author: Brenden Conley
date: 2016-03-07 17:17:44.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8260/ : SUCCESS

-------------------------------------
author: Brenden Conley
date: 2016-03-07 18:03:15.000000000

Patch Set 5: -Verified

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

-------------------------------------
author: Brenden Conley
date: 2016-03-07 18:33:55.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8261/ : SUCCESS

-------------------------------------
author: Brenden Conley
date: 2016-03-07 18:35:19.000000000

Patch Set 5: -Verified

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

-------------------------------------
author: Brenden Conley
date: 2016-03-07 19:03:50.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8262/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2016-03-07 19:11:51.000000000

Patch Set 5:

> > Uploaded patch set 5.
 > 
 > Whoa. You rebased onto https://git.eclipse.org/r/#/c/67701/6 . Not
 > sure that'll help yet with that failing test. My change isn't
 > stable yet either. I didn't properly account for the
 > RepositoryChangeScanner (at least I hope that was the reason why
 > build 8257 was unstable). It may run at the same time as the test
 > for no cached repos, which then will of course fail. See my last
 > comment over there. I'll try to get that fixed tonight, but if I
 > don't make it, we could in the worst case xxx@xxx.xxx that failing
 > test temporarily.

yes, I did since I got tired watching failing tests, and after rebasing the same tests succeeded 3 times in a row :-)

-------------------------------------
author: Alayna Houston
date: 2016-03-08 00:10:17.000000000

Patch Set 5: Code-Review+2

(2 comments)

Looks fine; just two minor nits.

Line:92, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Could be final.

Line:443, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> While you're touching this, why not add the missing braces? And maybe use dirs.isEmpty()?

-------------------------------------
author: Douglas Trujillo
date: 2016-03-08 01:07:07.000000000

Patch Set 5:

(2 comments)

Line:92, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Done

Line:443, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Done

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-03-15 14:59:20.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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