Migrate project from RCS to git?

佐手、 提交于 2019-11-29 20:46:12

See InterfacesFrontendsAndTools page on Git Wiki, in "Tools", "Interaction with other Revision Control Systems", "Other". There you would find a description and a link to rcs-fast-export (gitweb) Ruby script by Giuseppe "Oblomov" Bilotta.

(Web search would find also Ohloh page and announcement for mentioned project).

OK, after a little tinkering, I found it was trivial to convert RCS to CVS. The files are in the same format, so it's simply a matter of moving the files into an existing CVS root. This assumes you have access to the RCS files.

# Create CVS root dir. You only need to do this once.
mkdir $HOME/cvs/
cd $HOME/cvs/
cvs init

# Import a repository from RCS to CVS
cp -a _projectname_/RCS $HOME/cvs/_projectname_

As a general rule you should be careful as to what scripts you run. For RCS -> GIT it may be in your best interest to follow the RCS->CVS->GIT methodology.

Took a quick look at rcs-fast-export.rb as of 2011-01-12 and ran across this portion of the code. This is scary at best.

# steal username/email data from other init files that may contain the
# information
def steal_username
    [
            # the user's .hgrc file for a username field
            ['~/.hgrc',   /^\s*username\s*=\s*(["'])?(.*)\1$/,       2],
            # the user's .(g)vimrc for a changelog_username setting
            ['~/.vimrc',  /changelog_username\s*=\s*(["'])?(.*)\1$/, 2],
            ['~/.gvimrc', /changelog_username\s*=\s*(["'])?(.*)\1$/, 2],
            []
    ].each do |fn, rx, idx|
...

Just found this, which worked fine for me:

http://cynic.cc/blog/posts/migrate-from-rcs-to-git/

Just note that "cvs-source-dir" on that page needs to be a absolute path.

user317023

I had this problem too and wrestled with cvs2svn, parsecvs and whatnot. parsecvs got the closest but Keith seems to have left it behind and now random forks are popping up. The problem I struck with it was it would parse the RCS files just fine but the last thing it did was git rm the file, so I would have had to muck around with git reset to undo the deletion.

Then I discovered mercurial's convert: https://www.mercurial-scm.org/wiki/ConvertExtension Problem solved!

I tried to incrementally add some stuff from separate RCS trees, it seems to have worked.

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