I'm a p4 command line user. Typical use case, I search for a pattern in all files, open these files for edit, SED to replace the pattern, submit only those files modified.
How to do this from command ? Is there a way to create a new changelist, add these files to the changelist and submit the new changelist to default changelist.
The
p4 -xglobal flag lets you pass the contents of a file (or stdin as-) to ap4command as arguments. Thep4 editcommand accepts an arbitrary number of files arguments; thep4 submitcommand will operate on all open files by default.Note that the
p4 printandp4 diffcommands in the above example are not necessary to submit the files; I just included that output to show the state of the files at those points in the process for purposes of understanding the example.