撤消P4Python中的变更列表



我在使用p4python撤消Perforce中的更改时遇到问题,因为我已经提交了现在要撤消的更改列表。我的想法是首先创建一个变更列表,然后运行undo。但是,我做错了什么,文件无法撤消。

# new_cl is the created changelist
# cl_to_undo is the changelist to undo.
# description is string
P4.run("undo", '-c'+new_cl, filePath+"@" + cl_to_undo, description)
# Submit
P4.submit(new_cl)

愿意提供任何帮助。谢谢

undo命令不接受description参数。

C:Perforcetest>p4 help undo
undo -- Undo a range of revisions
p4 undo [-n] [-c changelist#] file[revRange]

您应该在创建new_cl时设置它的Description字段(假设您在脚本的早期有一些代码,该代码使用p4.get_changep4.save_change创建了一个挂起的变更列表,并设置了一个描述——将description文本放在其中(。

最新更新