问题描述
我在 Linux 机器上有一个 p4 客户端工作区.
I have a p4 client workspace on Linux machine.
我在客户端空间中添加/编辑了几个文件,然后尝试将这些更改提交到 perforce 服务器.
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"
(同样的命令适用于 Windows 机器)
当我只用 p4 submit
尝试它时,它打开了一个 p4 提交表单,然后我用正确的描述替换了 [在此处输入描述] 标记,然后它就可以工作了.
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.
但我不想为每个 p4 提交任务编辑 p4 提交表单.
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?
答案
-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
推荐答案
来自 http://www.perforce.com/perforce/downloads/platform.html 下载相应版本的 p4 命令行客户端.然后:
From http://www.perforce.com/perforce/downloads/platform.html download the appropriate version of p4 command-line client. Then:
- 用新的替换现有的 p4 可执行文件.
- 或者将新的 p4 exe 放在
$PATH
中较早的目录中 - 制作
chmod 755
hash -r
p4 -V
以验证您正在运行 perforce 2009.1 客户端p4 帮助提交
- 我们可以对 p4 二进制文件进行 md5sum
p4 info
并验证 perforce 服务器是 2006.2 或更新版本.
- Replace the existing p4 executable with the new one.
- Or put the new p4 exe in a directory earlier in your
$PATH
- Make the
chmod 755 <new p4>
hash -r
p4 -V
to verify you are running perforce 2009.1 clientp4 help submit
- We can md5sum the p4 binary
p4 info
and verify the perforce server is 2006.2 or more recent.
第 5 步应该产生:
$ p4 -V
Perforce - The Fast Software Configuration Management System.
Copyright 1995-2009 Perforce Software. All rights reserved.
Rev. P4/LINUX26X86/2009.1/205670 (2009/06/29).
第 6 步应该产生:
$ p4 help submit
submit -- Submit open files to the depot
p4 submit [ -r -s -f option ]
p4 submit [ -r -s -f option ] files
p4 submit [ -r -f option ] -d description
p4 submit [ -r -f option ] -d description files
p4 submit [ -r -f option ] -c changelist#
p4 submit -i [ -r -s -f option ]
'p4 submit' commits a pending changelist and its files to the depot.
With no argument 'p4 submit' attempts to submit all files in the
'default' changelist. Submit provides the user with a dialog
similar to 'p4 change' so the user can compose a changelist
description. In this dialog the user is presented with the list
of files open in changelist 'default'. Files may be deleted from
this list but they cannot be added. (Use an open command (edit,
add, delete) to add additional files to a changelist.)
If a (single) file pattern is given, only those files in
the 'default' changelist that match the pattern will be submitted.
The -c flag submits the numbered pending changelist that has been
previously created with 'p4 change' or a failed 'p4 submit'.
The -d flag allows a description to be passed into submit rather
than using a numbered changelist or engaging in a change description
dialog. This option is useful when scripting but does not allow for
jobs to be added or the default changelist to be modified.
The -f flag allows a submit option to be passed into submit which
will override the one that is set in the client. See 'p4 help client'
for valid submit options.
The -i flag causes a changelist specification (including files to be
submitted) to be read from the standard input. The user's editor
is not invoked.
The -r flag allows submitted files to remain open (on the client's
default changelist) after the submit has completed.
The -s flag extends the list of jobs to include the fix status
for each job, which becomes the job's status when the changelist
is committed. See 'p4 help change' for more notes on this option.
Before committing a changelist submit locks all associated files not
already locked. If any file cannot be locked, or if the submit
fails for any other reason the files are left open in a newly
created pending changelist.
Submit is guaranteed to be atomic. Either all files will be
updated in the depot as a unit or none will be.
其中重要的一点是:
The -d flag allows a description to be passed into submit rather
than using a numbered changelist or engaging in a change description
dialog. This option is useful when scripting but does not allow for
jobs to be added or the default changelist to be modified.
第 7 步:
$ md5sum $(which p4)
bef01f66b8d3964c74a2d8992c0c900c /opt/perforce/bin/p4
第 8 步:
该功能是在 perforce 2006.2 中引入的,并且有可能它需要一个足够新的服务器来支持操作:
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:
#106450 (Bug #258) **
'p4 submit' now sports a '-d description' option. This allows
the user to submit files without the need for a changelist
dialog. See 'p4 help submit'.
这篇关于如何在不传递 p4 提交表单中的描述的情况下执行 p4 提交操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!