0

我正在寻找一个脚本,它获取 CVS 模块的工作副本,执行任何必要的“cvs add”和“cvs remove”命令,并提交所有内容。最终结果是存储库副本变得与工作副本完全相同。

我想我以前见过类似的东西,但我在谷歌上找不到。有没有人用过类似的脚本?我知道我可以运行“cvs -nq update”并自己解析结果,这就是我可能最终会做的事情。但是 CVS 有各种奇怪的边缘情况,所以我想找到一个已经测试过的脚本,如果它存在的话。

4

1 回答 1

1

I wrote something similar as a macro for WinCvs that still comes bundled with it. You can find it under Macros|CVS|Copy to branch/trunk...

It will prompt you for a branch name to copy the current selection to (just leave blank if you want it copied to the trunk) and then makes all the necessary preparations you mentioned except for the final commit.

I only used it in practice a couple of times myself but it has been out there for a couple of years now and I haven't had any complaints...

From the docstring:

======
Usage:

  • Select one or more CVS-controlled files or folders.

  • Run the macro from the Macros|CVS menu.

  • Enter the name of the branch you want to copy the selection to or just hit OK if you want to copy to HEAD.

=============
Known Issues / "Un-niceties":

  • When copying individual files that were added on a branch the automatic adding will not work as CVS will assume the tag of the directory which would be incorrect (this results in a "foo.txt added independently by a second party" error message). It's usually better to always use the macro on directory selections.

  • An update -P in a .cvsrc file could potentially mess up recreation of folders added on a branch, so I explicitly disable use of .cvsrc and set compression fixedly to -z7 (reasonable IMO). All other .cvsrc options will be lost.

于 2009-02-08T00:09:31.990 回答