P4 命令行说明,用于从模板创建工作区并对客户端规范进行其他更改

P4 Command line instructions for creating workspace from a template and make additional changes to client spec

我希望从模板工作区 MC_CRM_BUILD_1XAB 创建 P4 工作区 ST_TEST_BUILD1。

我想在我的新工作区中更改 cspec。除了来自模板的 cspec 映射之外,我希望添加以下内容。

如何在 linux 上使用 P4 命令行执行此操作?我现在的 OS 是 Ubuntu。如果我想自动执行此操作,我应该使用 shell 脚本还是 python 或 perl?

P4Perl 和 P4Python 脚本 API 具有允许您以编程方式操作客户端规范的接口;一般的想法是,您将 运行 client -o 获取客户端规范,向视图字段添加一些内容,然后使用 client -i 保存格式化结果。您也可以很容易地在 shell 中执行此操作:

p4 --field "View+=//source/map/data/... //ST_TEST_BUILD1/map/data/..." --field "View+=//source/audio/data/... //ST_TEST_BUILD1/audio/data/..." --field "View+=//source/video/data/... //ST_TEST_BUILD1/video/data/..." client -t MC_CRM_BUILD_1XAB -o ST_TEST_BUILD1 | p4 client -i