2009-12-08 98 views
1

我在Linux機器上有p4客戶端工作區。如何執行p4提交操作而不通過p4提交表單中的描述

我在客戶端空間中添加/編輯了幾個文件,然後嘗試將這些更改提交給perforce服務器。

我做下面的步驟,但未能取得成功:

p4 submit -d "test"(Windows機器上相同的命令作品)

當我剛p4 submit試圖然後打開P4提交表單,然後我換成[進入這裏描述]令牌與正確的描述,然後它的作品。

但我不想爲每個p4提交任務編輯p4提交表單。

如何從命令提示符傳遞此信息?

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 
+0

以何種方式失敗? – 2009-12-08 13:28:00

+1

您應該將答案張貼爲答案 - 不要將其添加到問題中...... – 2009-12-10 13:10:43

回答

0

這不只是說明你需要輸入,您還可以編輯變更表規範,它允許你排除在提交的文件。

如果你可以在Windows上做到這一點,那麼在windows上可能有一個比你在Linux上使用的更新的客戶端?

+0

實際上,我的p4客戶端不支持使用p4提交的-d標誌。任何人都可以發送p4Commandlineclient的任何下載鏈接,它支持p4提交命令的「-d標誌」。 – praveen 2009-12-08 13:19:02

0

http://www.perforce.com/perforce/downloads/platform.html下載相應版本的p4命令行客戶端。然後:

  1. 用新的替換現有的p4可執行文件。
  2. 或者把新P4 exe文件的目錄早些時候在$PATH
  3. 充分利用chmod 755 <new p4>
  4. hash -r
  5. p4 -V驗證您正在運行的Perforce 2009.1客戶
  6. p4 help submit
  7. 我們可以MD5SUM的P4二進制
  8. p4 info並驗證perforce服務器是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). 

步驟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介紹,這是可能的,它需要一個足夠新服務器支持的操作:

#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'. 
+0

已經退出此鏈接並嘗試使用「Linux內核2.6 for 32位Intel(x86)」平臺進行p4CommandLineClient下載。但仍然p4提交命令不支持-d標誌。我做了「p4幫助提交」,它沒有顯示-d標誌支持。 – praveen 2009-12-08 14:12:18

+0

然後你還沒有成功下載並安裝新版本的p4。 – 2009-12-08 14:17:07

+0

我用p4 -V命令測試了我的p4客戶端。它返回2009客戶端信息。「$ p4 -V Perforce - 快速軟件配置管理系統。版權所有1995-2009 Perforce軟件。保留所有權利。版本P4/LINUX26X86/2009.1/205670(2009/06/29)。」但仍然「p4 help submit」沒有顯示-d標誌 – praveen 2009-12-08 14:34:14