自动添加、删除和提交的 CVS 脚本

发布于 2024-07-13 03:55:03 字数 241 浏览 2 评论 0原文

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

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

I'm looking for a script which takes a working copy of a CVS module, performs any necessary "cvs add" and "cvs remove" commands, and commits everything. The end result is that the repository copy becomes exactly like the working copy.

I think I've seen something like this before, but I couldn't find it on Google. Does anyone have a similar script that they've used? I know I can run "cvs -nq update" and parse the results myself, and that's what I'll probably end up doing. But CVS has all sorts of weird edge cases, so I'd like to find an already-tested script if it exists.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱皱眉﹌ 2024-07-20 03:55:03

我为 WinCvs 编写了类似的宏,但仍然与它捆绑在一起。 您可以在宏|CVS|复制到分支/主干下找到它...

它将提示您输入分支名称以将当前选择复制到(如果您希望将其复制到主干,请保留空白),然后进行所有必要的操作除了最终提交之外,您提到的准备工作。

我自己只在实践中使用过它几次,但它已经存在几年了,我没有任何抱怨......

来自文档字符串:

======
用法:

  • 选择一个或多个 CVS 控制的文件或文件夹。

  • 从“宏”|CVS 菜单运行宏。

  • 输入要将所选内容复制到的分支的名称或只是
    如果您想复制到 HEAD,请点击“确定”。

============
已知问题/“不礼貌”:

  • 复制添加到分支上的单个文件时,自动
    添加将不起作用,因为 CVS 将采用该目录的标签
    将是不正确的(这会导致“foo.txt 由
    第二方”错误消息)。
    通常最好始终在目录选择上使用宏。

  • .cvsrc 文件中的 update -P 可能会扰乱重新创建

    在分支上添加的文件夹,因此我明确禁用 .cvsrc 和

    压缩固定为 -z7 (IMO 合理)。 所有其他 .cvsrc
    选项
    将会丢失。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文