这段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发布于 2015-05-19 21:47:50
'change-commit trigger‘是一个拼写错误吗?更改提交触发器在更改完全提交后被称为,并且不能对其进行任何修改。
如果要在提交过程中更改更改列表,则需要使用更改提交或更改内容触发器。
发布于 2015-08-19 22:45:47
由于您指的是在更改-提交/内容触发器期间,下面是我要做的:
details = p4.fetch_change(changelistNumber)
description = details['Description']
# Make changes to description
details[descriptionKey] = description
p4.save_change(details)https://stackoverflow.com/questions/30317740
复制相似问题