andsee Posted June 17, 2013 Report Share Posted June 17, 2013 We have a workspace for a whole project, part of this turns out to be re-usable and as such we want to move it out of it's current repository into it's own and setup an xLink so that the existing repository uses the library from it's new location. We shall then also set up xLinks to use the library in 2 new project repositories. The question is how can I move a directory (with history) from one repository to another? One approach that I've considered is to copy the whole existing repository (somehow) and the move the relevant library directory to the root and delete the rest of the repositories' content. What's the best approach, is there support for this kind of refactoring? Andrew. Link to comment Share on other sites More sharing options...
calbzam Posted June 18, 2013 Report Share Posted June 18, 2013 Hi, It´s not possible to move the history of a directory between repositories. If you want to use a folder of a repository in a different one, a good approach could be: create a Xlink to the repository that contains the folder. Then you can play with cloaking rules in order to update only the desired folder in your workspace and not the rest of the content. This way, you workspace would contain your own code plus the folder linked from a different repository. Regards, Carlos Link to comment Share on other sites More sharing options...
andsee Posted July 4, 2013 Author Report Share Posted July 4, 2013 Would the following approach work? Duplicate the repository database and then add it as a new 'lib' repository via cm addrep. <-- This is the main bit I'm not sure if it is safe to do. Delete all files that we don't want in the xlink area from the 'lib' repository and shift the directory we are interested in to the root. Now delete the directory we have in 'lib' from the original repository. Hopefully I can then xlink the contents of 'lib' back into the original repository and have the history? I guess one downside of this is that the 'lib' repository will also contain the whole of the original project in it's history but I'm ok with that if it's the only downside. Link to comment Share on other sites More sharing options...
StevenTCramer@gmail.com Posted July 29, 2014 Report Share Posted July 29, 2014 I too want something similar. When one starts working on a project we don't know that we may be working on reusable code and later want to extract that code into its own repo and make a nuget/library out of it. what should be its own repo? And how can one clean up repos that are not designed properly? Link to comment Share on other sites More sharing options...
calbzam Posted July 30, 2014 Report Share Posted July 30, 2014 Hi, The approach to link repositories in Plastic is using Xlinks. If you don´t want to download the entire linked repository, you can configure cloaked rules to download to your workspace only the desired files. PD: Another possibility could by to replicate the library repo into a new clean repository, but only including the desired branches. Theis was you can "clean up" the repository including only some specific branches. Regards, Carlos Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.