简体   繁体   English

源代码控制从Accurev迁移到Git(.net)

[英]Source Control Migration from Accurev to Git (.net)

Currently we have a big project, about 10GB (including dlls), probably around 5GB without dlls, in Accurev and it is really slow to get / up / promote etc... 当前我们在Accurev中有一个大项目,大约10GB(包括dll),大约5GB(不包含dll),安装/升级/升级等确实很慢。

We are thinking of migrating to GIT, but biggest problem is it is a big monolith plus the way it is structured, we have one DEPOT for all projects. 我们正在考虑迁移到GIT,但是最大的问题是它是一个庞大的组件,加上它的结构方式,我们为所有项目都有一个DEPOT。 We have a LIBRARY folder where all the projects are built to, instead of the bin folder, so libraries references could be shared. 我们有一个LIBRARY文件夹,而不是bin文件夹,所有项目都建立在该文件夹中,因此可以共享库引用。 Every library is built to that LIBRARY folder, and all inter project references are referencing the dlls in the LIBRARY folder. 每个库都建立在该LIBRARY文件夹中,并且所有项目间的引用都引用LIBRARY文件夹中的dll。

How can we start to chunk out the project and migrate to GIT? 我们如何开始对项目进行分块并迁移到GIT? I was thinking of setting up an internal NUGET SERVER and NUGET-ting the current common libraries first, put them on GIT...then slowly migrate others over, splitting projects per repo, not a single repo (depot) like now. 我当时在考虑建立一个内部NUGET SERVER并先将当前的通用库NUGET-ting,然后将它们放在GIT上...然后慢慢地迁移其他库,按每个存储库拆分项目,而不是像现在这样拆分一个存储库。

Any suggestions? 有什么建议么?

You could use the script I wrote, ac2git , to convert your repo to git but it might take a while. 您可以使用我编写的脚本ac2git将您的存储库转换为git,但这可能需要一段时间。

After the conversion you could use the git filter-branch --subdirectory-filter to separate the converted monolith git repo into per project git repos. 转换后,您可以使用git filter-branch --subdirectory-filter将转换后的整体git repo分为每个项目git repos。

It should work but it will probably be slow. 它应该可以工作,但是可能会很慢。

Alternatively, if you're up for it, you could modify my script to do what you want. 或者,如果您愿意,可以修改我的脚本以执行所需的操作。 You would just need to make sure that it runs the accurev pop command only on the directories that you're interested in while it is converting the repo which would make it quicker per project but the same speed over all. 您只需要确保它在accurev pop仅在您感兴趣的目录上运行accurev pop命令即可,这会使每个项目更快,但accurev pop速度相同。

Edit: 编辑:

If you decide that you want to only convert a single folder at a time it would be trivial for you to hard code the script to do what you want. 如果您决定一次只转换一个文件夹,那么对脚本进行硬编码以执行所需的操作就很简单了。 All you need to do is modify all the calls to accurev.pop() (of which there is only one in the AccuRev2Git.TryPop() function) and add another argument to the call specifying which folder you wish to populate. 您需要做的就是修改对accurev.pop()所有调用accurev.pop()AccuRev2Git.TryPop()函数中只有一个),然后在该调用中添加另一个参数,以指定要填充的文件夹。

def TryPop(self, streamName, transaction, overwrite=False):
    for i in xrange(0, AccuRev2Git.commandFailureRetryCount):
        # --- Remove this line --- #
        #popResult = accurev.pop(verSpec=streamName, location=self.gitRepo.path, isRecursive=True, isOverride=overwrite, timeSpec=transaction.id, elementList='.')
        # --- And add this instead --- #
        popResult = accurev.pop(verSpec=streamName, location=self.gitRepo.path, isRecursive=True, isOverride=overwrite, timeSpec=transaction.id, elementList='/./<your project folder>')
        # --- End hardcoding hack --- #
        if popResult:
            break
        else:
            self.config.logger.error("accurev pop failed:")
            for message in popResult.messages:
                if message.error is not None and message.error:
                    self.config.logger.error("  {0}".format(message.text))
                else:
                    self.config.logger.info("  {0}".format(message.text))

    return popResult

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM