gpt4 book ai didi

python - p4python 修改变更列表说明

转载 作者:太空宇宙 更新时间:2023-11-04 03:33:02 28 4
gpt4 key购买 nike

此 p4python 代码片段获取 perforce 描述并删除了描述中提到的方括号。我计划在更改提交触发器期间调用此脚本,以在提交更改之前替换 CL 描述。不知道出了什么问题,但是触发器没有接受我的新更改描述。有没有人尝试使用 p4python 来做这个?非常感谢任何提示

describe = p4.run('describe', changeList)
print describe

description = describe[0].get('desc')
print description

description = description.replace('[', '')
description = description.replace(']', '')
print description

先描述打印

[{'status': 'pending', 'changeType': 'public', 'rev': ['21'], 'client': 'workspace1', 'user': 'username', 'time': '1432010818', 'action': ['edit'], 'type': ['text'], 'depotFile': ['//depot/repo/Vagrantfile'], 'change': '12345', 'desc': '[ABC-789] testfile commit'}]

第一个描述打印

[ABC-789] testfile commit

第二个描述去掉了方括号

ABC-789 testfile commit

最佳答案

“更改提交触发器”是拼写错误吗?更改提交触发器在更改完全提交后被调用,并且不能对其进行任何修改。

如果您想在提交过程中更改更改列表,您需要使用更改提交或更改内容触发器。

关于python - p4python 修改变更列表说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30317740/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com