如果我在P4V中提交更改者,我想通过P4触发器更改更改者的描述。
像这样,
用更改扣(或变更命令)触发执行的命令,但描述没有更改。
p4 --field Description=DESCRIPTIONS... change -o CHANGELISTNUM | p4 change -i -u
我已经尝试了P4更改选项-i -u和-i -f,All Option不适用于触发命令。(脚本)
(在触发器工作的环境中,由于超级用户帐户已登录,因此可以使用-f选项。)
是否有人通过触发器更改了描述?
谢谢
If I submit the changelist in P4V, I'd like to change the description of the changelist through the P4 trigger.
like this,

https://www.perforce.com/manuals/p4sag/Content/P4SAG/scripting.triggers.push.html
Command executed with change-submit(or change-commit) trigger but Description did not change.
p4 --field Description=DESCRIPTIONS... change -o CHANGELISTNUM | p4 change -i -u
I've tried p4 change options -i -u and -i -f, all option not working on trigger command.(script)
(In the environment where the trigger works, the -f option is possible because the superuser account is logged in.)
Has anyone changed the description through the trigger?
Thanks ????
发布评论
评论(1)
是的;如果您使用
-f
,它应该有效。-U
除非触发器作为拥有变更者的用户(即执行提交的用户)运行,否则-f
只要有效扳机作为管理员运行。如果不起作用,请仔细检查您的权限。简单示例:
触发器不在命令外壳中执行,因此,如果要使用
|
重定向之类的shell功能,则可能需要明确使用命令壳来处理命令行(在我的情况下CMD /C < /code>执行该作业)。
请注意提交输出中的Extra
更改301更新
;这就是触发器的p4更改-i
回声回到客户端的输出。如果您的触发器不起作用,请仔细查看您从p4提交
的输出,因为它可能包含一条错误消息,该消息使您有一个线索,触发器失败。如果您看到整个更改规格都回到了您身上,那就是重定向不起作用的线索。 (如果您找不到P4V中的任何触发器输出,请从CLI进行测试提交;如果您仍然找不到任何触发器,请仔细检查触发器的触发器条目,并记录服务器日志。)请注意,请注意< Code> Change-Submit 是A pre-Submit 触发器,而
Chage> Change-Commit
是A subsubmit 触发器。如果您希望扳机成功提交后发射,则需要Change-Commit
。Yes; it should work if you use
-f
.-u
won't work unless the trigger is running as the user who owns the changelist (i.e. the user who's doing the submit), but-f
will work as long as the trigger is running as an admin. If it's not working, double check your permissions.Simple example:
Triggers don't execute in a command shell, so if you want to use shell features like
|
redirection, you may need to explicitly use a command shell to process the command line (in my casecmd /c
does that job).Note the extra
Change 301 updated
in the submit output; that's the output of the trigger'sp4 change -i
being echoed back to the client. If your trigger isn't working, look carefully at the output that you're getting from thep4 submit
, since it will probably contain an error message that gives you a clue where the trigger is failing. If you see the entire change spec being echoed back to you, that's a clue that the redirection isn't working. (If you can't find any trigger output in P4V, go do a test submit from the CLI; if you still can't find any, double check the triggers entry for typos, and the server log for errors.)Note that
change-submit
is a pre-submit trigger, whereaschange-commit
is a post-submit trigger. If you want the trigger to fire after a successful submit, you wantchange-commit
.