| Summary: | Renaming a linked project folder incorrectly moves the files on disk | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Server | Assignee: | Aidan Redpath <aidanr> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | ahunter.eclipse |
| Version: | 5.0 | ||
| Target Milestone: | 7.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Mark Macdonald
There are project.json files for both projects in my workspace folder: // orion.client.json (old project) > { > "ContentLocation": "file:/C:/Users/mamacdon/code/orion/client/", > "FullName": "orion.client", > "OrionVersion": 4, > "Properties": {}, > "UniqueId": "orion.client", > "WorkspaceId": "m-OrionContent" > } // !orion.client.json (renamed project) > { > "ContentLocation": "file:/C:/Users/mamacdon/orionworkspace/foo/m/m/OrionContent/!orion.client", > "FullName": "!orion.client", > "OrionVersion": 4, > "Properties": {}, > "UniqueId": "!orion.client", > "WorkspaceId": "m-OrionContent" > } My workspace.json contains entries for both projects: > { > "FullName": "Orion Content", > "OrionVersion": 4, > "ProjectNames": [ > "orion.client", > ... > "!orion.client" > ], > "Properties": {}, > "UniqueId": "m-OrionContent", > "UserId": "m" > } Also, I'm running the Orion server from Eclipse
> INFO org.eclipse.orion.server.config - Server configuration file loaded from: C:\Users\mamacdon\code\orion\client\bundles\org.eclipse.orion.client.core\web-ide.conf
> INFO org.eclipse.orion.server.config - Loaded simple metadata store (version 4).
FWIW, I was able to achieve the desired behavior manually: - Change the ProjectNames entry in workspace.json - Change the FullName in project.json - Rename project.json to match ^ This metadata-only operation is what I expecting to have happen originally. > I was able to recover, but this behavior was unexpected and destructive. In
> previous versions of Orion (I think) you could rename a linked project
> without modifying the project content on disk. I expected that to still be
> the case.
The linked folder name should change, but the content location should not change.
The linked folder source does not have metadata file, so the server thinks it has to move it even though there is a metadata file linked to it. https://git.eclipse.org/r/#/c/28644/1 The change to WorkspaceResourceHandler is not correct.
The line: String sourceName = source.getName(); is wrong, it is returning the name of the linked folder not the project name.
metaStore.readProject() should not fail as this is a valid project.
The code should fall into: //a project move is simply a rename projectInfo.setFullName(destinationName); metaStore.updateProject(projectInfo);
And the metastore should handle this case.
Looks like:
String sourceName = source.getName();
Should be the final segment of sourceLocation.
There is another bug at work here as the source location should not even exist.
For example, I update my orion.conf with:
orion.file.allowedPaths=/tmp/bee
Then create a project "Link with Server" named foo with location /tmp/bee
I can see the {user}-OrionContent/foo is being created on disk, this is wrong.
This may be a source of the problem.
This problem also occurs when you try to move a linked project into another project. This is also related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=437773 |