SCM: Move a file without loosing history into another folder in same component
Deepali Deshmukh (89●1●42●61)
| asked Sep 22 '16, 2:28 a.m.
edited Sep 22 '16, 1:08 p.m. by David Lafreniere (4.8k●7)
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
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.
Thank you Ralph for your reply.
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.
Naveen Tyagi
commented Sep 22 '16, 5:50 a.m.
Hi Ralap,
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.
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 !
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? 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
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 Thank you Dinesh.
By following same steps, can we move file to cross repository workspaces or cross project areas without losing history? |
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
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.
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.
|
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.