HOWTO: smooth CVS to SVN migration

本文介绍如何将CVS版本控制系统平滑迁移到Subversion,并保持对未迁移用户的CVS匿名访问。通过使用cvs2svn工具创建SVN仓库,并通过hook脚本实现SVN提交同步回CVS仓库,确保了两个系统的无缝对接。
部署运行你感兴趣的模型镜像

HOWTO: smooth CVS to SVN migration (and back again)

This page explains how I migrated the VideoLAN CVS repositories to Subversion while still allowing anonymous CVS access for users who did not want to move to Subversion. If you are a CVS user and have not yet fallen in love with Subversion, I suggest you have a look at this excellent project. In fact, I recommend to be familiar with Subversion before reading this document, because I may have missed important things.

The idea is to migrate the CVS repository to a Subversion repository using cvs2svn, disable CVS accounts (except read-only accounts such as anonymous) and set up post-commit hooks to replicate SVN commits back to the CVS repository.

First step: cvs2svn

Here are the preparatory steps to migrate a CVS module wooyay from the CVS root /cvs/stuff to a new SVN repository /svn/wooyay:

$ svnadmin create /svn/wooyay
$ cvs2svn -s /svn/wooyay /cvs/stuff/wooyay
$ svn ls file:///svn/wooyay
branches/
tags/
trunk/
$

That’s all! Your SVN repository is created. The default layout is a bit special but quite handy: tags are in tags/, branches are in branches/, and HEAD is trunk.

Don’t forget to backup your old CVS tree! It might be useful if something ever gets wrong.

Repository cleaning

Now that your repository is created, you can use Subversion’s magical powers to do whatever you want to the repository, such as removing and renaming branches or tags. These steps are not mandatory but you might find them convenient.

CVS branch names cannot start with a digit or contain periods, and you end up with branches called v1_2_3 instead of 1.2.3. And I don’t like that. Here is an example of what I would do:

$ svn ls file:///svn/wooyay/branches
test/
v1_0/
v2_0/
$ svn rm file:///svn/wooyay/branches/test -m "removed branch"
$ svn mv file:///svn/wooyay/branches/v1_0 file:///svn/wooyay/branches/1.0 -m "renamed branch"
$ svn mv file:///svn/wooyay/branches/v2_0 file:///svn/wooyay/branches/2.0 -m "renamed branch"
$ svn ls file:///svn/wooyay/branches
1.0/
2.0/
$

I also like to import .cvsignore files to Subversion properties and set the "Id" keyword properties for files containing the "$Id:" special string. If your repository is big, you might want to do this change only for trunk/ and the still active branches.

$ svn checkout file:///svn/wooyay/trunk workingdir
$ cd workingdir/
$ find -name .cvsignore | while read file; do
    svn propset svn:ignore "`cat "$file"`" "`echo "$file" | sed 's,/[^/]*$,,'`"
  done

$ find . -type f -a '(' -path '*/.*' -prune -o -print ')' | while read file; do
    if grep -q '/$Id:' "$file" && ! svn propget svn:keywords "$file" | grep -q '^Id$'; then svn propset svn:keywords Id "$file"; fi
  done

$ svn commit -m "imported svn:ignore and svn:keywords properties"
$

The post-commit hook

This is the important part. My svn_cvsinject script can be used to reinject SVN commits into the old CVS directory. Use option -r to specify the revision to reinject, and -a to do branch aliases. In our example, this would be the contents of the /svn/wooyay/hooks/post-commit file:

#!/bin/sh
REPOS="$1"
REV="$2"
svn_maillog "$REPOS" "$REV" "svn@localhost" "sam@localhost"
svn_cvsinject -r "$REV" "$REPOS" "/cvs/stuff/wooyay" /
    -a "1.0/v1_0" -a "2.0/v2_0" &
exit 0

It is advisable to run svn_cvsinject in the background because it can take a long time to finish. Also, make sure that all users with commit rights (including the user svnserve might run as) have write permissions on the CVS repository.

Here are the current svn_cvsinject features:

  • support for file creation and removal
  • support for directory creation and removal
  • support for simultaneous commits in different branches
  • support for branch aliases

However, it also has the following current limitations:

  • no support for new branches
  • no user mapping when run from svnserve (but the user is mentioned in the commit log)
  • concurrent calls may break things (use locks)
  • poor error handling

Conclusion

It works for me (tm), but I’d be happy to learn of other successful installations. And please tell me of failures as well, so that I can fix bugs!

If your CVS repository ever gets corrupted, you can reinject every SVN commit by restoring your backuped CVS tree and calling svn_cvsinject again for every revision since you used cvs2svn

您可能感兴趣的与本文相关的镜像

PyTorch 2.6

PyTorch 2.6

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

Nano-ESG数据资源库的构建基于2023年初至2024年秋季期间采集的逾84万条新闻文本,从中系统提炼出企业环境、社会及治理维度的信息。其构建流程首先依据特定术语在德语与英语新闻平台上检索,初步锁定与德国DAX 40成分股企业相关联的报道。随后借助嵌入技术对文本段落执行去重操作,以降低内容冗余。继而采用GLiNER这一跨语言零样本实体识别系统,排除与目标企业无关的文档。在此基础上,通过GPT-3.5与GPT-4o等大规模语言模型对文本进行双重筛选:一方面判定其与ESG议题的相关性,另一方面生成简明的内容概要。最终环节由GPT-4o模型完成,它对每篇文献进行ESG情感倾向(正面、中性或负面)的判定,并标注所涉及的ESG具体维度,从而形成具备时序特征的ESG情感与维度标注数据集。 该数据集适用于多类企业可持续性研究,例如ESG情感趋势分析、ESG维度细分类别研究,以及企业可持续性事件的时序演变追踪。研究者可利用数据集内提供的新闻摘要、情感标签与维度分类,深入考察企业在不同时期的环境、社会及治理表现。此外,借助Bertopic等主题建模方法,能够从数据中识别出与企业相关的核心ESG议题,并观察这些议题随时间的演进轨迹。该资源以其开放获取特性与连续的时间覆盖,为探究企业可持续性表现的动态变化提供了系统化的数据基础。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值