在P4Python中撤消更改列表

k4ymrczo  于 2023-04-13  发布在  Python
关注(0)|答案(1)|浏览(126)

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

# 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)

会很感激任何帮助的。谢谢。

xggvc2p6

xggvc2p61#

undo命令不接受description参数。

C:\Perforce\test>p4 help undo

    undo -- Undo a range of revisions

    p4 undo [-n] [-c changelist#] file[revRange]

您应该在创建new_clDescription字段时设置它(假设您的脚本中有一些代码可以创建一个包含p4.get_changep4.save_change的挂起更改列表,并且它设置了一个描述--将您的description文本放在那里)。

相关问题