It's all about the answers!

Ask a question

Prevent WPF files not under SCM from being deleted on Load?


Art Corl (2642) | asked Apr 28 '10, 8:53 p.m.
edited Oct 12 '17, 11:15 p.m. by David Lafreniere (4.6k7)

Is there any way to do a "load" without existing files (not under source control) from being deleted from my project?

That is ... I create a Portlet Factory project in Eclipse. This gives me base "factory" code. Then I add files to the project as I develop my portlet. When I "check-in", the team settings in eclipse are smart enough to ignore the base portlet factory files (they don't get checked in).

But ... if someone wants to load my portlet code from RTC, they will create a portlet factory project (to get the base stuff), and then want to load my code from RTC. A "load", though, will wipe out the base portlet factory code.

Any way to avoid this? (Other than to re-add project facets ... and other project settings ... which is a bit tedious.)

Accepted answer


permanent link
Michael Valenta (3.6k3) | answered Apr 30 '10, 10:26 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 12 '17, 11:17 p.m. by David Lafreniere (4.6k7)

What you could do is use the Team-->Share Project action to hook up the
project to the corresponding remote folder. This will allow you to see
the differences between the local and remote in the Pending Changes
view. You may end up with a bunch of deletions for content that exists
remotely but not locally. If you Undo these, the content should be loaded.

Michael

P.S. I haven't tried this myself but conceptually it should work.

David Lafreniere selected this answer as the correct answer

Comments
Erik anderson commented Apr 30 '10, 8:42 p.m. | edited Oct 13 '17, 1:53 p.m.

I can verify Michael's suggestion - I worked with WPF development and this is the solution for working with WPF projects in RTC:

Developer 1
- create a new WPF project in your workspace (this creates a project with only the WPF project template files)
- create your models, profile sets, java classes, etc
- create .jazzignore for top level .project and .classpath
- share your project to source control (Team > Share) and pick a component in a workspace to share it in - the WPF provided excludes will ensure only project artifacts created by the developer are shared, not the project template files
- modify the project artifacts and checkin/checkout as necessary

Developers 2-n
- create a new WPF project in your workspace - use the same name as developer 1
- share the project to SCM - it's important the project name matches the directory of your WPF project
- undo any subtractions (this will copy down the changes)
- modify the project artifacts and checkin/checkout as necessary


Erik anderson commented Apr 30 '10, 9:00 p.m. | edited Oct 13 '17, 1:53 p.m.

Just want to say that this isn't a problem with WPF or RTC. The key is to re-share the project to connect the new WPF project to the files already under source control. The deleting mentioned in the original post was due to loading the same project name in Eclipse (the wrong way to work in this case).


Art Corl commented May 04 '10, 1:37 p.m. | edited Oct 13 '17, 1:53 p.m.

Works great! I also tried the same technique with a RAD portlet/EAR project ... works!

Thanks!!!

2 other answers



permanent link
Jean-Michel Lemieux (2.5k11) | answered Apr 28 '10, 10:00 p.m.
JAZZ DEVELOPER
I don't think there are many options, either this code is useful to others and you can un-ignore it and check it in, or you can check it in and keep it in a change set that you don't deliver. This can become tedious though.

I'm curious, how did you handle this before?

Comments
Art Corl commented Apr 29 '10, 9:39 a.m. | edited Oct 12 '17, 11:16 p.m.

With other source control systems I have used ... that have eclipse plugins ... the function of "syncing" with the code repository would never delete files from the local workspace. If the file exists in both the local workspace and in the code repository, of course it would overwrite the local copy (if you want it to). But it would leave other files in your project untouched.


permanent link
Ralph Schoon (59.5k23642) | answered Apr 29 '10, 10:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Jean-Michel,

what would be needed is some sort of "private" versioned file that would live in the repository workspace but not necessarily be delivered to the stream.

There where several requests for this kind of things recently. It is always interesting if one needs to be able to hold some private configuration in files that should not affect the files in the stream. Potential candidates would be server configuration files etc. that are just local but required.

Other examples could be eclipse launch files that users would want to customize for a different local setting but not share or create conflicts with the server version. Actually this is even a more mixed example where you want a versioned file in the stream but you want to be able to change it and keep the private change without affecting the common stream. This could be done manually taking care the change never gets delivered.



Ralph

I don't think there are many options, either this code is useful to others and you can un-ignore it and check it in, or you can check it in and keep it in a change set that you don't deliver. This can become tedious though.

I'm curious, how did you handle this before?

Comments
Art Corl commented Apr 29 '10, 10:17 a.m. | edited Oct 12 '17, 11:16 p.m.

I'd guess there's a need to not even have the files in the repository workspace. This set of files could be quite large (as in the case of portlet factory), and really no need at all to have it in the repository.


Ralph Schoon commented Apr 29 '10, 10:54 a.m. | edited Oct 12 '17, 11:16 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Art,

I guess I haven't understood your problem right and am talking about a completely different one. Your issue seems to be completely reverse actually from what i was thinking i understood in the first round. Sorry for that.

You say you have local files in the Eclipse workspace and they get deleted when loading, which you'd like to avoid, right? I think the load deletes existing projects and their content first and then recreates them. I don't think it deletes other projects. Could you work with a setup where the files you'd like to preserve are in another project?


I'd guess there's a need to not even have the files in the repository workspace. This set of files could be quite large (as in the case of portlet factory), and really no need at all to have it in the repository.

Your answer


Register or to post your answer.