我已经想好了如何分支和提交我的更改,但由于我使用像Jira这样的项目管理平台,我还需要对每个签入写一个描述。这是我的分支代码:
result = p4.run("populate", Path+"/...@"+ Changelist, destination)
我在哪里写描述?现在的描述就是命令本身。
C:Perforcetestpython>p4 help populate
populate -- Branch a set of files as a one-step operation
p4 populate [options] fromFile[rev] toFile
p4 populate [options] -b branch [-r] [toFile[rev]]
p4 populate [options] -b branch -s fromFile[rev] [toFile]
p4 populate [options] -S stream [-P parent] [-r] [toFile[rev]]
options: -d description -f -m max -n -o
所以:
result = p4.run(
"populate",
"-d",
"My awesome description",
f"{src_path}/...@{changelist}",
f"{dst_path}/..."
)
您也可以使用integrate
和submit
命令(注意,这需要dst_path
是您的客户端视图的一部分,因为文件将在提交之前在您的客户端上打开(:
p4.run("integrate", f"{src_path}/...@{changelist}", f"{dst_path}/...")
p4.run("submit", "-d", "My awesome description")