perforce 每个分支的任务
我正在准备一个关于 p4 的研讨会,我正在尝试找到使用“每个分支任务”方法的最佳方法,现在我正在使用以下步骤:(全部通过 CLI)
将我的客户端设置为root depot 以创建新分支。 看法: //depot/... //myMachine/...
p4 -c myClient integ -v //depot/MAIN/... //depot/myBranchX/...
p4 -c myClient 提交 -d“分支”
再次改变我的客户目标到新的分支机构。 看法: //depot/myBranchX/... //myMachine/...
p4 -c myClientsync
我想知道是否有最快/更好的方法来做到这一点。特别是与巨大的存储库和分支合作。
谢谢! M。
i'm preparing a seminary about p4 and i'm trying to find the best way to use the "Task per branch" methodology, now i'm using the following steps: (all by CLI)
Set my client to the root depot in order to create the new branches.
View:
//depot/... //myMachine/...p4 -c myClient integ -v //depot/MAIN/... //depot/myBranchX/...
p4 -c myClient submit -d "Branching"
Change again my client aiming to the new branch.
View:
//depot/myBranchX/... //myMachine/...p4 -c myClient sync
i'm wondering if there's a fastest/better way to do it. Specially working with huge repositories and branches.
Thanks!
M.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以...您想为每个任务/错误创建一个分支,并且您希望新创建的分支映射到客户端/工作区,如果它是主干。您希望能够通过命令行或运行脚本来实现这一点。正确的?
好的。
您想采用此工作流程的原因是什么?您是否正在开发关键软件,即生死攸关的场景,其中每个任务都是孤立的,并且在集成到主线之前需要进行彻底审查。
除非您遇到上述情况,否则我建议您不要使用此工作流程。为每项任务创建一个分支,尤其是在大型存储库中,最终将使您的 Perforce 服务器陷入困境。最近,Perforce 博客上发布了类似的情况作为反模式(不该做什么)。 Perforce 反模式第 2 部分:过度使用分支.
想一想。
如果您仍然想继续,那么您可以通过编写一个 shell 脚本(DOS、Bash、Python**)来实现您想要的,该脚本将上述命令组合在一起,并使用任务/分支名称等的一些参数。如果需要,请评论进一步帮助做到这一点。
** 首选,然后使用 py2exe 编译脚本作为可执行文件进行分发。
So... you want to create a branch for each task/bug and you want the newly created branch to mapped to client/workspace as if it was the trunk. And you want to be able to this via the command line or by running a scrip. Correct?
OK.
What is there a reason you want to adopt this workflow? Are you working on critical software, i.e., life/death scenario where every task is isolated and needs to be thoroughly vetted before integrating into the main line.
Unless you have a situation like above I would recommend against this workflow. Creating a branch for every task, especially in a large repository will eventually bring your Perforce server to a crawl. An similar situation was posted recently on the Perforce Blog as an Anti-Pattern (what not to do). Perforce Anti-Patterns Part 2: Overuse of branching.
Think about it.
If you still want to proceed, then you can achieve what you want by writing a shell script (DOS, Bash, Python**) that groups the above commands together taking a few arguments for the task/branch name etc. Comment if you need further help in doing this.
** preferred, then compile the script using py2exe as an executable for distribution.