背景
我正在尝试从 CVS 存储库中抢救代码。我正在reposurgeon
为此目的使用,并且我尝试了以下工具来让自己git-fast-import
流式传输:
cvs-fast-export
, 出错(所谓的循环分支,但未提供详细信息)cvs2git
其次git-fast-export
,它把事情混搭在了无法理解的范围之内git-cvsimport
其次是git-fast-export
,它创造了迄今为止最好的结果,但最终也会把东西扔到他们不属于的树枝上。
此 CVS 存储库已在各种 CVS 版本上运行,并且标签和分支已被强制移动。我知道这意味着我不能再挽救那些分支和标签了。但就这样吧。
尽管如此,我有六个分支(在更多分支中),加上MAIN
,我有兴趣在转换为git-fast-import
流期间保留这些分支。我的目标 VCS不是Git,但关键是reposurgeon
它以这种方式处理其输入并以这种方式输出。
为了理解工件并在预处理阶段通过rcs -o<rev>
(当然是在我的 repo 的副本上)清理尽可能多的旧东西(包括孤立的修订版),我需要了解如何rcsfile
格式工作的内部结构。
rcsfile.py
修改模块后解析是小菜一碟rcsgrep
。但这还没有为我提供任何有关修订号的信息,尤其是那些没有相应 delta+log 的修订号的含义。
我所看到的
根据RCS 文件手册页,不应该出现修订 ID 的第三段为 0 的情况。但我确实看到了这种情况。
这是我所做的(作为实验)。
- On
MAIN
: 提交文件 (1.1
) - 从
MAIN
: 分支到BranchX
(1.1
) - On
BranchX
: 更改文件 (1.1.2.1
) - On
BranchX
: 再次更改文件 (1.1.2.2
) - On
MAIN
: 更改文件 (1.2
) - On
MAIN
: 标记文件foobar
(1.2
) - 从
MAIN
: 分支到BranchX
,移动分支标记 (1.2
),有效地将前一个分支孤立在1.1.2.x
- On
BranchX
: 删除文件 (1.2.2.1
) - On
MAIN
: 更改文件 (1.3
) - On
MAIN
: 强制标记文件foobar
(1.3
) - On
MAIN
: 更改文件 (1.4
) - On
MAIN
: 标记文件foobarbaz
(1.4
)
正如您在上面的列表和下面完全复制的文件中看到的那样,没有1.2.0.2
以带日志的 delta 形式进行的修订。
现在我的问题
如果我新分支修订版x.y
(没有文件更改!),则生成的修订版 ID 为x.y.0.2
. 这类似于我看到和询问的神秘修订 ID。
- 是否
0
表明该文件没有增量,因此我必须返回其祖先以获取实际内容? - 还是 0 只是表示该分支的“根”,第四段是该分支的最新版本?
谁能阐明这些问题或指出比上面链接的手册页更全面的材料?
以下是完整的 RCS 文件:
head 1.4;
access;
symbols
foobarbaz:1.3
foobar:1.4
BranchX:1.2.0.2;
locks; strict;
comment @# @;
1.4
date 2014.12.11.13.46.46; author username; state Exp;
branches;
next 1.3;
1.3
date 2014.12.11.13.44.49; author username; state Exp;
branches;
next 1.2;
1.2
date 2014.12.11.13.39.31; author username; state Exp;
branches
1.2.2.1;
next 1.1;
1.1
date 2014.12.11.13.31.41; author username; state Exp;
branches
1.1.2.1;
next ;
1.1.2.1
date 2014.12.11.13.34.36; author username; state Exp;
branches;
next 1.1.2.2;
1.1.2.2
date 2014.12.11.13.35.08; author username; state Exp;
branches;
next ;
1.2.2.1
date 2014.12.11.13.42.32; author username; state dead;
branches;
next ;
desc
@@
1.4
log
@Change on MAIN
@
text
@NOTE: this file will be removed!
Another change on MAIN@
1.3
log
@Change on MAIN
@
text
@d3 1
a3 1
ANother change on MAIN@
1.2
log
@Change on MAIN
@
text
@d3 1
a3 1
File on MAIN will be forcibly tagged X again ... how does this affect the rev ID?@
1.2.2.1
log
@Removing the two files from X
@
text
@@
1.1
log
@Adding the experiment file
@
text
@d3 1
a3 1
Introducing file on MAIN@
1.1.2.1
log
@Changing the file on the X branch
@
text
@d3 1
a3 1
Changing on X branch@
1.1.2.2
log
@Another change on the X branch
@
text
@d3 1
a3 1
Another change on the X branch@