Jump to content


question about p4 change -i

p4 change p4 command

  • Please log in to reply
8 replies to this topic

#1 wz6881

wz6881

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 December 2016 - 02:09 PM

Hi,

I'm trying to do shell command that automatically create CL and submit.
so, now I stopped by the command p4 change -i,   from the document that is reading standard input ,but I can not figure out what should I do here.
just like the command 'p4 submit ',  I can use 'p4 submit -d ' to indicate the CL description in the cmd line, but what should I do for 'p4 change -i ' ?  to let the shell run itself without interaction?

Thanks very much.
@

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1065 posts

Posted 13 December 2016 - 04:35 AM

For what you describe ("create changelist and submit"), just use "p4 submit -d MYDESCRIPTION".  The submit command will create a changelist for you automatically and submit it.

But to answer the general question of how to create a changelist with a particular description, do:

p4 --field "Description=MYDESCRIPTION" change -o | p4 change -i

#3 wz6881

wz6881

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 December 2016 - 05:44 AM

View PostSambwise, on 13 December 2016 - 04:35 AM, said:

For what you describe ("create changelist and submit"), just use "p4 submit -d MYDESCRIPTION".  The submit command will create a changelist for you automatically and submit it.

But to answer the general question of how to create a changelist with a particular description, do:

p4 --field "Description=MYDESCRIPTION" change -o | p4 change -i

Thank you !   that is exactly what I want.

#4 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 13 December 2016 - 12:25 PM

Originally posted to the perforce-user mailing list by: Michael Mirman


Global option --field??
Is it documented anywhere?

--
Michael Mirman
MathWorks, Inc.
508-647-7555

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On Behalf Of Sambwise
Sent: Monday, December 12, 2016 11:40 PM
To: perforce-user@perforce.com
Subject: [p4] question about p4 change -i

Posted on behalf of forum user 'Sambwise'.

For what you describe ("create changelist and submit"), just use
"p4 submit -d MYDESCRIPTION".��The submit command will
create a changelist for you automatically and submit it.

But to answer the general question of how to create a changelist with a
particular description, do:

p4 --field "Description=MYDESCRIPTION" change -o | p4 change -i



--
Please click here to see the post in its original format:
  http://forums.perfor...out-p4-change-i
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user


#5 Robert Cowham

Robert Cowham

    Advanced Member

  • PCP
  • 271 posts
  • LocationLondon, UK

Posted 13 December 2016 - 12:48 PM

p4 help undoc

    p4 --field Field=replacement_text
    p4 --field Field+=extra_text
        Modify the contents of a spec returned by p4 [specname] -o.  The
        modified spec can be piped directly to another command that expects
        a formatted spec, e.g. p4 [specname] -i.

:)
Co-Author of "Learning Perforce SCM", PACKT Publishing, 25 September 2013, ISBN 9781849687645

"It's wonderful to see a new book about Perforce, especially one written by Robert Cowham and Neal Firth. No one can teach Perforce better than these seasoned subject matter experts"
  • Laura Wingerd, author of Practical Perforce, former VP of Product Technology at Perforce

#6 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 13 December 2016 - 02:00 PM

Originally posted to the perforce-user mailing list by: Chuck Pflaum


Hello Michael,
It is documented in ‘p4 help undoc’.

p4 --field Field=replacement_text
p4 --field Field+=extra_text
Modify the contents of a spec returned by p4 [specname] -o.  The
modified spec can be piped directly to another command that expects
a formatted spec, e.g. p4 [specname] -i.

Regards,
Chuck Pflaum

On 12/13/16, 4:20 AM, "perforce-user on behalf of Michael Mirman" <perforce-user-bounces@perforce.com on behalf of Michael.Mirman@mathworks.com> wrote:

    Global option --field??
    Is it documented anywhere?

    --
    Michael Mirman
    MathWorks, Inc.
    508-647-7555

    -----Original Message-----
    From: perforce-user [mailto:perforce-user-bounces@perforce.com] On Behalf Of Sambwise
    Sent: Monday, December 12, 2016 11:40 PM
    To: perforce-user@perforce.com
    Subject: [p4] question about p4 change -i

    Posted on behalf of forum user 'Sambwise'.

    For what you describe ("create changelist and submit"), just use
    "p4 submit -d MYDESCRIPTION".��The submit command will
    create a changelist for you automatically and submit it.

    But to answer the general question of how to create a changelist with a
    particular description, do:

    p4 --field "Description=MYDESCRIPTION" change -o | p4 change -i



    --
    Please click here to see the post in its original format:
      http://forums.perfor...out-p4-change-i
    _______________________________________________
    perforce-user mailing list  -  perforce-user@perforce.com
    http://maillist.perf...o/perforce-user


_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user


#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1065 posts

Posted 13 December 2016 - 03:59 PM

The blog was also a good source of info for new features including the undoc-ish ones:

https://www.perforce...nd-line-roundup

#8 Matt Janulewicz

Matt Janulewicz

    Advanced Member

  • Members
  • PipPipPip
  • 222 posts
  • LocationSan Francisco, CA

Posted 13 December 2016 - 06:16 PM

I've always thought it was funny/ironic to have to tell people "It's documented in undoc." :)
-Matt Janulewicz
Currently unemployed, looking for work in Boise, ID!

#9 inayi

inayi

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 29 May 2019 - 05:43 PM

This is really helpful!!!
Do you know how to append a new line character to the description? If I want to add multiple lines to the description without opening emacs window?

View PostRobert Cowham, on 13 December 2016 - 12:48 PM, said:

p4 help undoc

p4 --field Field=replacement_text
p4 --field Field+=extra_text
Modify the contents of a spec returned by p4 [specname] -o.  The
modified spec can be piped directly to another command that expects
a formatted spec, e.g. p4 [specname] -i.

Posted Image






Also tagged with one or more of these keywords: p4 change, p4 command

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users