Perforce 如何在不传递p4提交表单中的说明的情况下执行p4提交操作

Perforce 如何在不传递p4提交表单中的说明的情况下执行p4提交操作,perforce,Perforce,我在Linux机器上有一个p4客户端工作区 我在我的客户机空间中添加/编辑了几个文件,然后尝试将这些更改提交给Performce server 我按照以下步骤操作,但未能成功: p4 submit-d“test”(相同的命令在Windows机器上工作) 当我用p4 submit尝试它时,它打开了一个p4提交表单,然后我用正确的描述替换了[enter description here]令牌,然后它就工作了 但我不想为每个p4提交任务编辑p4提交表单 如何从命令提示符传递此信息 回答 -d flag

我在Linux机器上有一个p4客户端工作区

我在我的客户机空间中添加/编辑了几个文件,然后尝试将这些更改提交给Performce server

我按照以下步骤操作,但未能成功:

p4 submit-d“test”
(相同的命令在Windows机器上工作)

当我用
p4 submit
尝试它时,它打开了一个p4提交表单,然后我用正确的描述替换了[enter description here]令牌,然后它就工作了

但我不想为每个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
-d中未引入对p4提交命令的标志支持
perforce 2006版。下面是解决这个问题的方法:
要修改2006.2版之前的Performce服务器上的描述字段,请尝试
将更改表单导入/导出流编辑器。这将创建一个编号的
然后应提交变更列表。
例如,类似于:
p4变更-o | sed-e“s//my desc/”| p4变更-i
给出输出,类似于:
更改102使用3个打开的文件创建。
然后可以提交该变更(本例中为102号),如下所示:
p4提交-c 102

您不仅需要输入描述,还可以编辑变更列表规范,该规范允许您从提交中排除文件

如果您可以在windows上执行此操作,那么windows上可能有比您在Linux上使用的客户端更新的客户端?

从下载相应版本的p4命令行客户端。然后:

  • 用新的p4可执行文件替换现有的p4可执行文件
  • 或者将新的p4 exe放入
    $PATH
  • 制作
    chmod 755
  • hash-r
  • p4-V
    验证您是否正在运行Performce 2009.1客户端
  • p4帮助提交
  • 我们可以对p4二进制进行MD5求和
  • p4信息
    并验证Performce server是否为2006.2或更高版本
  • 第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).
    
    $ 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.
    
    第6步应产生:

    $ 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).
    
    $ 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
    
    第八步:
    该功能是在中引入的,可能需要足够新的服务器来支持该操作:

    #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提交的-d标志。任何人都可以向我发送p4Commandlineclient的下载链接,该链接支持p4提交命令的“-d标志”。已经通过此链接,并尝试使用“Linux内核2.6 for 32位Intel(x86)”平台下载p4Commandlineclient。但p4提交命令仍然不支持-d标志。我做了“p4帮助提交”,它没有显示-d标志支持。然后你还没有成功下载并安装新版本的p4。我已经用:p4-V命令测试了我的p4客户端。它返回2009年客户端信息。“$p4-V Perforce-快速软件配置管理系统。1995-2009 Perforce软件版权所有。保留所有权利。Rev.p4/LINUX26X86/2009.1/205670(2009/06/29)。”但“p4帮助提交”仍然没有显示对-d FLAG的支持。我不明白这是如何发生的。我有完全相同的版本,它有-d标志。我尝试使用“p4-Ztag info”命令。它显示perforce服务器在版本2006.1/109255上运行。这是这个问题的根本原因吗?你应该把答案作为答案发布,而不是添加到问题中。。。