It's all about the answers!

Ask a question

How to split/divide exiting RTC component into new ones?


Guowei Jim Hu (1.0k610353) | asked Feb 04 '10, 3:11 p.m.
Does RTC scm has the functionality somewhere to allow user to split/merge exiting components into new ones?

Say I have one component A with three top folders f1, f2, f3 and I want to created three new components and each will just hold one of them and maintain the original history in A.

I don't see a direct way to do it except the Replace with command.


Is it possible to just create anew component and move a whole folder from another component into it?

Accepted answer


permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 09 '10, 11:53 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Yes, you can do the refactoring after the import.
The history will not actually get moved to the new component, but a
backlink to the imported history will be stored with the versionable in
the new component.

And the refactoring works on any files and directories, not just Java
source code.

Cheers,
Geoff

ghu wrote:
gmclemmwrote:
Could you expand a bit on what you mean by "handle"? In
particular,
what are the operations that you want to apply to the imported
components, or what is the result that you want to achieve?

Cheers,
Geoff



Geoff,
After the import is done, I will have one RTC component contain all
the folder and files from SVN. My customr then want to move some of
the folders and files into new components.

I guessI can use Team->Move or Refactor to move them between
omponents without worying about the history and links? Are they only
work fr Java code?
Ralph Schoon selected this answer as the correct answer

20 other answers



permanent link
Guowei Jim Hu (1.0k610353) | answered Feb 04 '10, 3:20 p.m.
I read the follwoing in he RTC help:
If you need to, you can move projects from one component to another, or refactor a single component into multiple components.

My question is how to handle imported components from like SVN?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 04 '10, 8:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Could you expand a bit on what you mean by "handle"? In particular,
what are the operations that you want to apply to the imported
components, or what is the result that you want to achieve?

Cheers,
Geoff

ghu wrote:
I read the follwoing in he RTC help:
If you need to, you can move projects from one component to another,
or refactor a single component into multiple components.

My question is how to handle imported components from like SVN?

permanent link
Guowei Jim Hu (1.0k610353) | answered Feb 09 '10, 2:34 p.m.
Could you expand a bit on what you mean by "handle"? In particular,
what are the operations that you want to apply to the imported
components, or what is the result that you want to achieve?

Cheers,
Geoff



Geoff,
After the import is done, I will have one RTC component contain all the folder and files from SVN. My customr then want to move some of the folders and files into new components.

I guessI can use Team->Move or Refactor to move them between omponents without worying about the history and links? Are they only work fr Java code?

permanent link
Guowei Jim Hu (1.0k610353) | answered Feb 12 '10, 2:56 p.m.
Geoff,
I finalyy get the imaport done and tried the refactoring and got confusing results.

RTC offers Move and Move in Repository commands for moving projects and source folders around.

It looks like when one wants to move source folder from one component to another component, one has to first load the folder into a Eclipse project to enable the Move in Repository command.

The Move command seems to be only work for moving source folders aound in the same component.

The issue is that when you load one source folder into an Eclipse project , it becomes the top folder nomatter how deep it was located in the original source tree. And then if you use Move in Repository to move the folder into a new component, it is created as the top folder there too.

So if one wants to preserve the original path, then has to create them manually before the move. And this seems necessary when you have to move folders with the same name and you don't want to change the name in the new component.

Here is one example. I have in the original component two folders /src/discovery and /src/java/com/ibm/discovery and need to move them both to a new component. I can't load them into the same project due to name confliction, and after load them into two projects, I can only move one of them into the new component using Move in Repository due to name confliction. I'll have to either rename one of them or manualy create the path in the new component first.

But will this break the integraty of the source tree structure and build?

Do I miss or do something wrongly here to get into this?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 13 '10, 11:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Comments below:

ghu wrote:
Geoff,
I finalyy get the imaport done and tried the refactoring and got
confusing results.

RTC offers Move and Move in Repository commands for moving projects
and source folders around.

It looks like when one wants to move source folder from one component
to another component, one has to first load the folder into a Eclipse
project to enable the Move in Repository command.

Correct.

The Move command seems to be only work for moving source folders around
in the same component.

What makes you think that? You do have to have both components loaded
as projects in Eclipse, but then you should be able to use the Move command.

The issue is that when you load one source folder into an Eclipse
project , it becomes the top folder nomatter how deep it was located
in the original source tree.

That is controlled by the "Load" option you use. To load the entire
component, use the "Load the root folders as components" option. Note
that what makes this a bit confusing is that the standard Eclipse views
like the "package explorer" or "project explorer" only work against
Eclipse projects (i.e. directories that contain a .project file), rather
than arbitrary trees on disk. So this option "fakes it", by pretending
that the root directory of the component is in fact an Eclipse project
(you'll see that it creates a .project file for you in the root
directory of the component, to make Eclipse happy).

And then if you use Move in Repository
to move the folder into a new component, it is created as the top
folder there too.

If you use the above technique to load the entire component, you can use
the plain old "Move" command to move the file/folder wherever you
want in the other component.

So if one wants to preserve the original path, then has to create them
manually before the move. And this seems necessary when you have to
move folders with the same name and you don't want to change the name
in the new component.

Here is one example. I have in the original component two folders
/src/discovery and /src/java/com/ibm/discovery and need to move them
both to a new component. I can't load them into the same project due
to name confliction, and after load them into two projects, I can
only move one of them into the new component using Move in Repository
due to name confliction. I'll have to either rename one of them or
manualy create the path in the new component first.

But will this break the integraty of the source tree structure and
build?

Do I miss or do something wrongly here to get into this?

Try the approach I describe above, and things should work better for
you. One important note: Before you "complete" or "deliver" the
change set that results from checking in your various move/rename
operations, do the following:
- unload the two components
- open up the change set in each component, and find that fake
".project" file that was created in the root directory of each component
(to make Eclipse happy), and "undo" it (i.e. undo just the addition of
the root ".project" files).
Otherwise, you'll find a bogus ".project" file has been created in the
repository in the root of your components.

I've submitted work item 106037, asking for a way to load these kinds of
components into Eclipse, without the creation of the bogus .project
files in the component root directory.

Cheers,
Geoff

permanent link
Guowei Jim Hu (1.0k610353) | answered Feb 17 '10, 3:10 p.m.
Thanks, Geoff,
That is very helpful tips.

Still have one issue about the name confliction at the target component side.

I have two folders called web in the source component: /src/web and /src/java/com/exeros/web and need to move both to the target component.

I moved the fist /src/web to the target component without issue and it created a folder /component_name/web on the target component insead of one like /src/web as I expected.

Then when I tried to move the /src/java/com/exeros/web over, it warns that the existing web directory will be overwritten.

Is there a way to g around this?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 17 '10, 7:08 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you wanted to move orig-component/src/web to tgt-component/src/web
(but didn't want the other children of orig-component/src to be moved),
then you would have to first create a tgt-component/src directory, and
then move orig-component/src/web to tgt-component/src.

Similarly, if you want to move orig-component/src/java/com/exeros/web
over (but didn't want to move the other children of "src", "java", "com"
, or "exeros" over), then you would have to first create the directories
tgt-component/src, tgt-component/src/java, tgt-component/src/java/com
(etc), before performing the "move".

Cheers,
Geoff


ghu wrote:
Thanks, Geoff,
That is very helpful tips.

Still have one issue about the name confliction at the target
component side.

I have two folders called web in the source component: /src/web and
/src/java/com/exeros/web and need to move both to the target
component.

I moved the fist /src/web to the target component without issue and it
created a folder /component_name/web on the target component insead of
one like /src/web as I expected.

Then when I tried to move the /src/java/com/exeros/web over, it warns
that the existing web directory will be overwritten.

Is there a way to g around this?

permanent link
Guowei Jim Hu (1.0k610353) | answered Feb 18 '10, 7:30 a.m.
Thanks, Geoff,
That is what I did but expected the Move command to create the hierarchy to simplify the effort.

I think this will be a good enhancemen request as more teams convert from other version control system via importer and reorganize the source tree is going to be common case. An option in the Move wizard to allow user to specify if the original hierarchy should be preserved would be very helpful.

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 18 '10, 8:23 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This is an Eclipse command, not an RTC command, so you'd have to submit
this request at www.eclipse.org.

Cheers,
Geoff

ghu wrote:
Thanks, Geoff,
That is what I did but expected the Move command to create the
hierarchy to simplify the effort.

I think this will be a good enhancemen request as more teams convert
from other version control system via importer and reorganize the
source tree is going to be common case. An option in the Move wizard
to allow user to specify if the original hierarchy should be
preserved would be very helpful.

Your answer


Register or to post your answer.