andyj2ee

java tec sky

统计

留言簿(4)

activemq

aop

design pattern

other blog

spring

workflow

多线程

软件架构师

阅读排行榜

评论排行榜

2014年12月17日 #

系统cvs to Git 迁移

迁移简介

应用工具:cvs2git

工作原理:文件系统的copy, from cvs repository to export temp file, then import to Git repository.

使用条件: Git version 1.5.4.4 or later (我们的目标 git 库版本:

git --version

git version 1.9.0

git --version
git version 1.9.0

cvs2git工具安装

迁移过程

具体的迁移过程:

以下为迁移wxxr-core-framework

1. 在123.1上用cvs2git把cvs仓库,导出成git的备份文件(blob file and dump file)

  • cvs2git --blobfile=/tmp/cvs2git/output/git-blob-cfw.dat --dumpfile=/tmp/cvs2git/output/git-dump-cfw.dat --username=zhangjunqing --fallback-encoding=GBK /app/cvsroot/wxxr-projects/wxxr-core-framework
  • 创建本地git仓库 
    • git init --bare wxxr-core-framework.git
  • 下载导出的git的备份文件到本地临时目录 **
    • cd /Users/zhangjq/temp/cvs2git
    • scp -r djboss@192.168.123.1:/tmp/cvs2git/output/git-* . 
  • 用git的fast-import命令把从cvs导出的git备份文件导入刚创建的git仓库** cd /Users/zhangjq/git/wxxr-core-framework/wxxr-core-framework.git** cat /Users/zhangjq/temp/cvs2git/git-blob-cfw.dat /Users/zhangjq/temp/cvs2git/git-dump-cfw.dat | git fast-import
  • 在Stash 上创建远程仓库** 创建了framework-core 仓库集,并在此仓库集下创建了wxxr-core-framework, wxxr-core-web  等远程仓库**http://developer.corp.wxxr.com.cn/git/projects/FRMCORE/repos/wxxr-core-framework/browse
    •  
  • 在本地执行** git branch -D TAG.FIXUP (执行git branch -a 没有找到这个分支,为什么删除?error: branch 'TAG.FIXUP' not found. )
    • git gc --prune=now
    • git push --all origin  (将本地的所有分支都推送到远程主机)
    • git push -tags origin (最后,git push不会推送标签(tag),除非使用-tags选项。)
  • 至此,完成了wxxr-core-framework的迁移。下一步执行比较验证。

Git 时不时地将这些对象打包至一个叫 packfile 的二进制文件以节省空间并提高效率。当仓库中有太多的松散对象,或是手工调用git gc 命令,或推送至远程服务器时,Git 都会这样做。

附:迁移脚本

迁移验证

用本地cvs代码库代码与git下载的库代码比较,有$Revision$ 的少版本信息外,其它一切正常。

迁移报告

wxxr-core-framework

cvs2svn Statistics:
------------------
Total CVS Files:              3000
Total CVS Revisions:          9439
Total CVS Branches:          33449
Total CVS Tags:            3278944
Total Unique Tags:            2446
Total Unique Branches:          24
CVS Repos Size in KB:       159751
Total SVN Commits:            5260
First Revision Date:    Wed May 31 15:56:03 2006
Last Revision Date:     Sun Jan  4 17:22:23 2015
------------------
Timings (seconds):
------------------
1065   pass1    CollectRevsPass
0   pass2    CleanMetadataPass
0   pass3    CollateSymbolsPass
648   pass4    FilterSymbolsPass
1   pass5    SortRevisionsPass
37   pass6    SortSymbolsPass
436   pass7    InitializeChangesetsPass
82   pass8    BreakRevisionChangesetCyclesPass
82   pass9    RevisionTopologicalSortPass
296   pass10   BreakSymbolChangesetCyclesPass
406   pass11   BreakAllChangesetCyclesPass
413   pass12   TopologicalSortPass
319   pass13   CreateRevsPass
159   pass14   SortSymbolOpeningsClosingsPass
15   pass15   IndexSymbolsPass
432   pass16   OutputPass
4391   total

fast-import wxxr-core-framework source code:

git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:      45000
Total objects:        41365 (      2260 duplicates                  )
blobs  :         7817 (       709 duplicates       6887 deltas of       7248 attempts)
trees  :        30677 (      1551 duplicates      12608 deltas of      29589 attempts)
commits:         2871 (         0 duplicates          0 deltas of          0 attempts)
tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:        2472 (        24 loads     )
marks:     1073741824 (     11397 unique    )
atoms:           2772
Memory total:          4532 KiB
pools:          2423 KiB
objects:          2109 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit      = 8589934592
pack_report: pack_used_ctr            =      23737
pack_report: pack_mmap_calls          =        824
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =    7439224 /    7439224
---------------------------------------------------------------------

:)

@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

posted @ 2015-01-13 18:53 java光环 阅读(726) | 评论 (0)编辑 收藏

异常:java.lang.ArrayIndexOutOfBoundsException: 48188



[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 48188
    at org.objectweb.asm.ClassReader.readClass(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scanFile(DefaultMojoAnnotationsScanner.java:139)
    at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scan(DefaultMojoAnnotationsScanner.java:85)
    at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.scanAnnotations(JavaAnnotationsMojoDescriptorExtractor.java:125)
    at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.execute(JavaAnnotationsMojoDescriptorExtractor.java:104)
    at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:108)
    at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:233)
    at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:88)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

临时解决办法:将commons-jelly 版本由1.0改为1.0-RC1
        <dependency>
            <groupId>commons-jelly</groupId>
            <artifactId>commons-jelly</artifactId>
            <version>1.0-RC1</version>
        </dependency>

posted @ 2014-12-17 15:27 java光环 阅读(3683) | 评论 (0)编辑 收藏