Migrate from CVS to Mercurial: Separating projects

泪湿孤枕 提交于 2019-11-30 19:46:18

问题


We have a CVS repository with years of development history and 3 projects under one project (CVS folder). Those should be different repositories in a Mercurial repo. They are in the following scheme:

Project
---Sub Project 1
---Sub Project 2
---Sub Project 3

  1. Is there a way to automate this during the cvs2hg process?
  2. If not, what would be the Mercurial process to separate each sub project while keeping history (if possible).

回答1:


Simply run cvs2hg three times, each time pointing it at a project subdirectory within your CVS repository; e.g.,

cvs2hg [OTHER-OPTIONS...] $CVSROOT/Project/SubProject1

Write the results into three separate Mercurial repositories.




回答2:


The best way to do this is to convert the entire repository from CVS to mercurial and then use the hg convert command with a --filemap to convert that single mercurial repo into multiple mercurial repos (convert will convert from hg to hg). Your filemap will say something like:

include SubProject1
rename SubProject1 .

That will throw away everything that's not in sub project one and then move subproject one to the top (notice that trailing dot).

If you run that with a filemap for each of your sub projects, each time with the full repo as input, you'll end up with exactly what you want.

Some people have built shell scripts to do this, but if it's really just 3 of them it should be pretty quick.



来源:https://stackoverflow.com/questions/3789485/migrate-from-cvs-to-mercurial-separating-projects

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!