Jump to content


How to create stream from CLI without having to open editor?

p4 stream cli

  • Please log in to reply
3 replies to this topic

#1 mcru

mcru

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 February 2017 - 12:11 AM

I'm trying to create a p4 stream from the CLI w/o having to open the editor, and none of the normal tricks are working for me. For example, if this was a client spec, I can use the -o flag to pipe the contents of an existing client to p4 client -i.

My goal here is to alias 'p4 stream -P <current stream> -t task <generated dev task branch name>' that doesn't require editing the stream spec file at all.

Thanks!

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 152 posts

Posted 16 February 2017 - 12:52 AM

Do you get an error when you use the "-o" and "-i" flags?  They should work the same on every command that operates on a spec.

p4 stream -P <current stream> -t task <generated dev task branch name> -o | p4 stream -i

#3 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2447 posts

Posted 16 February 2017 - 02:20 AM

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


Remember, if you set P4EDITOR to /bin/true, the editor won’t open.
You can even avoid piping -o | -i with that. You just have to make sure you provide all necessary arguments for the stream spec. For example,
env P4EDITOR=/bin/true p4 stream -P <current-stream> -t task <new-stream>

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

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On Behalf Of mcru
Sent: Wednesday, February 15, 2017 7:15 PM
To: perforce-user@perforce.com
Subject: [p4] How to create stream from CLI without having to open editor?

Posted on behalf of forum user 'mcru'.

I'm trying to create a p4 stream from the CLI w/o having to open the editor,
and none of the normal tricks are working for me. For example, if this was a
client spec, I can use the -o flag to pipe the contents of an existing client to
p4 client -i.

My goal here is to alias 'p4 stream -P <current stream> -t task
<generated dev task branch name>' that doesn't require editing the
stream spec file at all.

Thanks!



--
Please click here to see the post in its original format:
  http://forums.perfor...-to-open-editor
_______________________________________________
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


#4 mcru

mcru

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 February 2017 - 03:18 PM

@Sambwise - I figured it out... the p4 stream command requires the -o to be before -P -t or stream name.

For example, "p4 stream -o -P //streamdepot/parent -t task //streamdepot/mynewstream | p4 stream -i" works, but "p4 stream -P
//streamdepot/parent -t task //streamdepot/mynewstream -o | p4 stream -i" throws p4 stream Usage.


Thanks Michael, that's a good trick to know!





Also tagged with one or more of these keywords: p4 stream, cli

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users