tags:

views:

504

answers:

2

I have p4 client workspace on Linux machine.

I added/edited few files in my client space and then try to submit those changes to perforce server.

I did below steps but could not succeed:

p4 submit -d "test" (same command works on windows machine)

when I tried with just p4 submit then it open p4 submit form and then I replaced [enter description here] token with proper description and then it works.

But I don't want to edit p4 submit form for every p4 submit task.

How can I pass this info from 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
A: 

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?

pixelbeat
Actually my p4 client does not support -d flag with p4 submit. Can any one send me any download link of p4Commandlineclient which supports "-d flag" for p4 submit commands.
praveen
A: 

From http://www.perforce.com/perforce/downloads/platform.html download the appropriate version of p4 command-line client. Then:

  1. Replace the existing p4 executable with the new one.
  2. Or put the new p4 exe in a directory earlier in your $PATH
  3. Make the chmod 755 <new p4>
  4. hash -r
  5. p4 -V to verify you are running perforce 2009.1 client
  6. p4 help submit
  7. We can md5sum the p4 binary
  8. p4 info and verify the perforce server is 2006.2 or more recent.

Step 5 should produce:

$ 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).

Step 6 should produce:

$ 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.

Of which the important bit is:

    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.

Step 7:

 $ md5sum $(which p4)
 bef01f66b8d3964c74a2d8992c0c900c  /opt/perforce/bin/p4

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'.
Douglas Leeder
Already gone thorugh this link and tried with "Linux kernel 2.6 for 32-bit Intel (x86)" platform for p4CommandLineClient download. But still p4 submit command does not supports -d flag. I did "p4 help submit", it was not showing -d flag support.
praveen
Then you haven't successfully downloaded and installed the new version of p4.
Douglas Leeder
I 've tested my p4 client with: p4 -V command. it returns the 2009 client info." $ 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)." But still "p4 help submit" does not show the support of -d flag
praveen
I don't understand how that can be happening. I have precisely the same version and it has the -d flag.
Douglas Leeder
I tried with "p4 -Ztag info" command. and it shows the perforce server is running on version 2006.1/109255. Is that the root cause of this problem?
praveen
I wouldn't have thought so, but maybe - certainly p4 needs to be able to contact the server to do `p4 help submit`, and our server is 2007.3.
Douglas Leeder
The release notes from perforce suggest it's a server feature, so you might be right.
Douglas Leeder
I'm not sure why Windows p4 would work in that case - is it talking to the same server?
Douglas Leeder
My bad, actually windows p4 client was pointing to p4 server 2009 not the one where Linux box is pointing. So when I point windows to same p4 server then I face same problem in both machine windows and Linux. As per perforce 2006 command reference -d flag is not supported. It got introduced in perforce 2006.2 version and that the problem
praveen
See the workaround which I 've followed for this problem. Many thanks for your support
praveen
You should post answers as answers - not add then to the question...
Douglas Leeder