Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

0 votes


Accepted answer

Permanent link

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

0 votes

Comments

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.

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?

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

For example:



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.


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.

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).

1 vote

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

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. 

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


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
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.

0 votes

Comments

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.

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




Permanent link
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.

0 votes

Comments

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.

1 vote

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

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.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,023
× 1,203
× 12

Question asked: Sep 22 '16, 2:28 a.m.

Question was seen: 6,777 times

Last updated: Oct 20 '20, 1:33 p.m.

Confirmation Cancel Confirm