It's all about the answers!

Ask a question

SCM: Move a file without loosing history into another folder in same component


Deepali Deshmukh (8914261) | asked Sep 22 '16, 2:28 a.m.
edited Sep 22 '16, 1:08 p.m. by David Lafreniere (4.8k7)
Hi All,

I want to move a file without loosing history into another folder in same component. I have come across solution that says navigate to Project explorer-->Right click on project-->select move. In my case its for folders present in components and not for any project. I am using CLM 6.0.2.

Is there anyway to achieve this in RTC eclipse client or web client ? Please help me with steps/links to move a file.
Any help would be appreciated.

Deepali Nigade

Accepted answer


permanent link
David Lafreniere (4.8k7) | answered Oct 15 '18, 12:30 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

The ability to move files and folders to other components has been added in RTC 6.0.3. You can use the context menu action of "Team" --> "Move in Repository". This action supports multi-selection in the RTC Eclipse client.

Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented Sep 22 '16, 3:13 a.m. | edited Oct 19 '20, 3:33 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you just want to move a simple file within one project or component use the move and refactor commands in Eclipse and the history will be preserved.

The history preserving bit in the help is only relevant for moving stuff across component borders.


Deepali Deshmukh commented Sep 22 '16, 4:06 a.m. | edited Sep 22 '16, 4:07 a.m.

Thank you Ralph for your reply.
I want to move a file as a part of configuration for components (Project area) and not for any project (Package Explore). I Don't find move option for the file in pending changes or under show repository files. How do i do it?


Ralph Schoon commented Sep 22 '16, 4:29 a.m. | edited Sep 22 '16, 4:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As I wrote, for all I know just use the usual client refactor rename or move capabilities.

For example:




Naveen Tyagi commented Sep 22 '16, 5:50 a.m.

Hi Ralap,
I think there is some misunderstanding. She isn't referring to move file in Eclipse but file from a component  to another component or from folder to another folder in same component  in RTC without losing the history of the file.



Ralph Schoon commented Sep 22 '16, 6:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I understand that. However, the "loosing history when moving" and its precautions is only relevant if you move across component boundaries. If you stay in a component any refactor rename/move to another folder should work, while it is under SCM.

And you need to use some kind of SCM client to move the file as well. As long as no one says different I assume the client is the Eclipse client.


1
Geoffrey Clemm commented Sep 23 '16, 11:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I think the misunderstanding is that Naveen is looking for a way in the Eclipse client to move files/folders that are not in an Eclipse project.   That is not possible ... Eclipse will only let you move files/folders that are in an Eclipse project.   So to do this move within Eclipse, you would need to create a dummy Eclipse project to make the files/folders to be moved visible in Eclipse (no need to checkin that dummy project ... it just needs to be around long enough to do the move).


Deepali Deshmukh commented Sep 28 '16, 2:44 a.m.

Thank you Geoffrey, you got it right !
I will go with the dummy project.


Ralph Schoon commented Sep 28 '16, 11:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I assumed they had used the obvious alternative way to load the top level folder as projects. You can by the way add the project file to the ignored resources and you can always load the folders as project without actually changing anything. 


R Z commented Oct 19 '20, 12:12 p.m.

 By following same steps, can we move file to cross repository workspaces or cross project areas without losing history?



David Lafreniere commented Oct 20 '20, 1:33 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Richie. The move will create a change set. There is no concept of moving a file from repository workspace to another, what you would do is simply accept that change set into a different repository workspace to have the move applied (and retain history). Or you can deliver the change set to a stream (note: There is no concept of 'cross project' areas really in terms of SCM. Files/folders exist in a component in a repo workspace or stream, and a component or stream can be 'owned' by a project area, but this 'owner' property just dictates who can change that component or stream (or what process advisors might fire during certain operations, etc.)

showing 5 of 10 show 5 more comments

2 other answers



permanent link
Deepali Deshmukh (8914261) | answered Oct 04 '16, 1:19 a.m.
Its working using the below steps.
1. Create a new dummy Eclipse project in the source component locally. 
·  Load the Component into repository workspace.
·  Select “load the root folders of the components as project”
·  Select “Load and create Eclipse projects for the selected folders ”
·  Click finish.
2. Open Package Explorer move the file/folder to where you really wanted it to go in the target folder.                    
3. Open Pending Changes, check the unresolved changes.   
4. Undo the local changes for .project file.
5. Check-in and Deliver changes for the moved file.

But Is there a way by which I can do in one Go. Can I move 600 files to the respective destination.

Comments
1
Ralph Schoon commented Oct 04 '16, 4:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Provide the file/folder structure. Otherwise my answer would be to use the RTC Jazz SCM CLI as suggested above. To be honest, manually using the UI is likely to be more error prone than writing a script.

I am not sure why you need to create an Eclipse project as you can load the component and let the load create the eclipse project.


R Z commented Oct 19 '20, 12:11 p.m. | edited Oct 19 '20, 12:12 p.m.
By following same steps, can we move file to cross repository workspaces or cross project areas without losing history?


Ralph Schoon commented Oct 19 '20, 1:04 p.m. | edited Oct 19 '20, 1:05 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
No. The answer above does not preserve history. The accepted answer shows how to move between components within a repository and keep history.

Moving across repository workspaces does not make sense to me.

There are other methods that can be used to copy scm data over repository boundaries. I will try to answer which ones you have in the new question you will want to create, rather than commenting on an answer to a 4 years old question that is kind of unrelated to what you want to achieve.

permanent link
Dinesh Kumar B (4.1k413) | answered Sep 22 '16, 3:45 a.m.
JAZZ DEVELOPER
Hi Deepali,

This would be available in rich client in v603, refer to the notes here :
 
     https://jazz.net/downloads/rational-team-concert/milestones/6.0.3M5?p=news#enhanced-compare

For now, you should be able to perform this move using the command line :
   $ lscm status -u clmadmin -P clmadmin
    Workspace: (1000) "ScrumForSourceControl_Stream" <-> (1001) "ScrumForSourceCont>
      Component: (1002) "ScrumForSourceControl Default Component"
        Baseline: (1003) 1 "Initial Baseline"

    $ ls
    SourceFolder        logs            trace
    TargetFolder        preferences.properties
    daemons            scratch

    $ lscm move -r https://clm602.ibm.com:9443/ccm -u clmadmin -P clmadmin SourceFolder/sampleToBeMoved.txt TargetFolder/
    Successfully moved.

    $ lscm status -u clmadmin -P clmadmin
    Workspace: (1000) "ScrumForSourceControl_Stream" <-> (1001) "ScrumForSourceCont>
      Component: (1002) "ScrumForSourceControl Default Component"
        Baseline: (1003) 1 "Initial Baseline"
        Unresolved:
          m-- /TargetFolder/sampleToBeMoved.txt


Once this unresolved change is checked in, you will see that move completed and I noticed that the history is also retained.

hope this helps.

Comments
Deepali Deshmukh commented Sep 22 '16, 4:18 a.m. | edited Sep 23 '16, 11:55 a.m.

Thank you Dinesh.
I need to move around 600 files, using CI it's bit error prone also my server is 6.0.0 V. Is there any way to do directly from web or eclipse client.


R Z commented Oct 19 '20, 12:11 p.m. | edited Oct 19 '20, 12:12 p.m.

By following same steps, can we move file to cross repository workspaces or cross project areas without losing history?



Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.