如何执行 p4 提交操作而不在 p4 提交表单内传递描述
我在 Linux 机器上有一个 p4 客户端工作区。
我在客户端空间添加/编辑了一些文件,然后尝试将这些更改提交到 perforce 服务器。
我按照以下步骤操作,但无法成功:
p4 Submit -d "test"
(相同的命令在 Windows 计算机上运行)
当我仅使用 尝试时p4 Submit
然后它打开了一个 p4 提交表单,然后我用正确的描述替换了 [在此处输入描述] 标记,然后它就起作用了。
但我不想为每个 p4 提交任务编辑 p4 提交表单。
如何从命令提示符传递此信息?
回答
-d flag support for p4 submit command was not introduced in
perforce 2006 version. so here is the workaround for this problem:
To modify the description field on pre-2006.2 release Perforce Servers, try
piping the change form in/out of a stream editor. This will create a numbered
changelist, which should then be submitted.
For example, something like:
p4 change -o | sed -e "s/<enter description here>/my desc/" | p4 change -i
Which gives the output, similar to:
Change 102 created with 3 open file(s).
This change (number 102 in this case) can then be submitted, as follows:
p4 submit -c 102
I have a p4 client workspace on Linux machine.
I added/edited few files in my client space and then tried to submit those changes to perforce server.
I followed the steps below but could not succeed:
p4 submit -d "test"
(the same command works on a Windows machine)
when I tried it with just p4 submit
then it opened a p4 submit form and then I replaced [enter description here] token with the proper description and then it works.
But I don't want to edit the p4 submit form for every p4 submit task.
How can I pass this info in from the command prompt?
Answer
-d flag support for p4 submit command was not introduced in
perforce 2006 version. so here is the workaround for this problem:
To modify the description field on pre-2006.2 release Perforce Servers, try
piping the change form in/out of a stream editor. This will create a numbered
changelist, which should then be submitted.
For example, something like:
p4 change -o | sed -e "s/<enter description here>/my desc/" | p4 change -i
Which gives the output, similar to:
Change 102 created with 3 open file(s).
This change (number 102 in this case) can then be submitted, as follows:
p4 submit -c 102
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不仅仅是您需要输入的描述,您还可以编辑更改列表规范,该规范允许您从提交中排除文件。
如果您可以在 Windows 上执行此操作,那么也许 Windows 上有比您在 Linux 上使用的客户端更新的客户端?
It's not just the description you need to enter, you also can edit the changelist specification which allows you to exclude files from the commit.
If you can do it on windows then perhaps there is a newer client on windows than what you're using on Linux?
来自http://www.perforce.com/perforce/downloads/platform.html 下载适当版本的 p4 命令行客户端。然后:
$PATH
中较早的目录中chmod 755
hash -r
p4 -V
验证您正在运行 perforce 2009.1 客户端p4 help Submit
p4 info
并验证 perforce 服务器是 2006.2 或更高版本。步骤 5 应该产生:
步骤 6 应该产生:
其中重要的一点是:
步骤 7:
步骤 8:
该功能是在 perforce 2006.2 中引入的,并且有可能它需要足够新的服务器来支持该操作:
From http://www.perforce.com/perforce/downloads/platform.html download the appropriate version of p4 command-line client. Then:
$PATH
chmod 755 <new p4>
hash -r
p4 -V
to verify you are running perforce 2009.1 clientp4 help submit
p4 info
and verify the perforce server is 2006.2 or more recent.Step 5 should produce:
Step 6 should produce:
Of which the important bit is:
Step 7:
Step 8:
The feature was introduced in perforce 2006.2, and it's possible that it requires a sufficiently recent server to support the operation: