Moving code from an existing component to a new component.
Hello...
I'm working with the .NET RTC client, and I have a solution containing App1 and Library1. App1 references Library1, and both projects are in the same Component in RTC, call it the Solution1 component. I'd like to share Library1. I know I can create a new RTC Component, and I know how to share that component across project areas and streams. But is there a way to move Library1 into its own Component such that when I view history on a file within the new Component, I see all the changes I made to files in Library1 while it was part of the Solution1 component? It would be easy enough to disconnect Library1 from RTC and just add it to a new Component, but then I lose the history (unless I go look in the Solution1 component). Thanks! Travis |
4 answers
travman wrote:
I'm working with the .NET RTC client, The Eclipse client has a Team > Move in Repository command that does exactly what you want. It moves a project to a new component and links up the SCM histories so changes from both components can show up in the same history view. Having never used the Visual Studio client, I have no idea if it has the same command. I guess if all else fails, you could install the Eclipse client, check out your repository workspace into Eclipse, move the project, and then go back to using the Visual Studio client. |
Visual Studio client gives access to the "Move in Repository" option for solution files, so here's how you'll do this:
Say, your sandbox is C:\Sandbox, and you have the following directory structure: C:\Solution1 C:\Solution1\Library1 C:\Solution1\App1 1. Unload Solution1, and load just Library1 using the "Load As" option directly under the sandbox, at C:\Library1 2. Create a blank solution under C:\Library1\Library1.sln 3. Share this solution. Save and check-in all unresolved changes 4. Choose "Move In Repository" from the solution's context menu |
travman wrote: I'm working with the .NET RTC client, The Eclipse client has a Team > Move in Repository command that does exactly what you want. It moves a project to a new component and links up the SCM histories so changes from both components can show up in the same history view. Having never used the Visual Studio client, I have no idea if it has the same command. I guess if all else fails, you could install the Eclipse client, check out your repository workspace into Eclipse, move the project, and then go back to using the Visual Studio client. The operation on the Eclipse client appears to allow moving a project to another component within the same Project Area or Workspace, is this correct? If I wanted to move a project into another component in another project or workspace, I could arrange to make it a flow target to get the refactored component in to another Project or Workspace. is that the best way? |
sky wrote:
The operation on the Eclipse client appears to allow moving a project I think the component that you move the project to has to be part of the same repository workspace as the component you are moving from. You will have to have (at least temporarily) a repository workspace with both components. Workspaces can contain components from multiple projects, so moving a project to a component in another project shouldn't be a problem. |