源代码控制从Accurev迁移到Git(.net) [英] Source Control Migration from Accurev to Git (.net)

查看:116
本文介绍了源代码控制从Accurev迁移到Git(.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前我们在Accurev中有一个大项目,大约10GB(包括dll),大约5GB,没有dll,并且启动/升级/升级等确实很慢...



我们正在考虑迁移到GIT,但是最大的问题是它是一个庞大的整体,加上它的结构方式,我们为所有项目都有一个DEPOT。我们有一个LIBRARY文件夹,而不是bin文件夹,所有项目都建立在该文件夹中,因此可以共享库引用。每个库都建立在该LIBRARY文件夹中,并且所有项目间引用均引用LIBRARY文件夹中的dll。



我们如何开始对项目进行分块并迁移到GIT?我当时在考虑建立一个内部NUGET SERVER,然后先将当前的通用库NUGET-ting,然后将它们放在GIT上……然后慢慢地迁移其他库,按每个存储库拆分项目,而不是像现在这样拆分一个存储库。 p>

有什么建议吗?

解决方案

您可以使用我写的脚本,< a href = https://github.com/orao/ac2git rel = nofollow> ac2git ,将您的存储库转换为git,但可能需要一段时间。



转换后,您可以使用 git filter-branch --subdirectory-filter 将转换后的整体git repo分成每个项目的git repos。



它应该可以工作,但是可能会很慢。



或者,如果您愿意的话,可以修改我的脚本以执行所需的操作。您只需要确保它在转换存储库时仅在您感兴趣的目录上运行 accurev pop 命令,这会使每个项目更快



编辑:



如果您决定您只想一次只转换一个文件夹,那么对脚本进行硬编码以执行所需的操作就很简单了。您需要做的就是修改对 accurev.pop()的所有调用(其中 AccuRev2Git.TryPop() 函数)并向其中添加另一个参数调用,指定要填充的文件夹。

  def TryPop(self,streamName,transaction,overwrite = False):$ b i在xrange(0,AccuRev2Git.commandFailureRetryCount)中的$ b:
#-删除此行--#
#popResult = accurev.pop(verSpec = streamName,location = self.gitRepo。 path,isRecursive = True,isOverride = overwrite,timeSpec = transaction.id,elementList ='。')
#---并添加它---#
popResult = accurev.pop(verSpec = streamName,location = self.gitRepo.path,isRecursive = True,isOverride = overwrite,timeSpec = transaction.id,elementList ='/。/<您的项目文件夹>')
#-结束硬编码破解---#
,如果popResult:
中断
否则:
self.config.logger.error( accurev pop failed:)
用于popResult中的消息。消息:
如果message.error不为None并且message.error:
self.config.logger.error( {0}。format(message.text))
否则:
self.config.logger.info( {0}。format(message.text))

return popResult


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...

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. We have a LIBRARY folder where all the projects are built to, instead of the bin folder, so libraries references could be shared. Every library is built to that LIBRARY folder, and all inter project references are referencing the dlls in the LIBRARY folder.

How can we start to chunk out the project and migrate to 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.

Any suggestions?

解决方案

You could use the script I wrote, ac2git, to convert your repo to git but it might take a while.

After the conversion you could use the git filter-branch --subdirectory-filter to separate the converted monolith git repo into per project 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.

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.

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

这篇关于源代码控制从Accurev迁移到Git(.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆