Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a perforce empty changelist from command line

i'm trying to create an empty changelist from command line using the command p4 change -i but seems that this command does nothing, i don't get any error/success message, the command line simply return nothing and i have to kill it with ctrl+c.

My p4 client works, i'm able to see all my info and doing all other operations correctly, seems to have problem only to create a new pending changelist.

Anyone experienced the same issue?

P.s. I've checked the P4V way to create an empty changelist and it actually using the p4 change -i command without any issue, but if i try to use the same command from cli it will silently fail.

like image 502
Max Avatar asked Aug 15 '16 14:08

Max


People also ask

How do you shelve a changelist?

Shelve changesIn the Commit tool window Alt+0 , right-click the files or the changelist you want to put to a shelf and select Shelve changes from the context menu. In the Shelve Changes dialog, review the list of modified files.

What is Perforce default changelist?

Perforce maintains a default pending changelist in the system metadata for every workspace. When you check out a file, you can add it to the default pending changelist for your workspace or create a new numbered pending changelist for your work.

How do I delete a file in changelist?

To delete a pending changelist, you must first remove all files and jobs associated with it and then issue the p4 change -d changenum command. Related operations include the following: To move files to another changelist, issue the p4 reopen -c changenum command.

How do I delete shelve?

To delete the Perforce P4 shelved files, use p4 shelve -d followed by the change number: p4 shelve -d -c 7033 Shelved change 7033 deleted. Having removed the shelved files by deleting the shelved change, you can remove the changelist itself: p4 change -d 7033 Change 7033 deleted.


2 Answers

If you're using the command line interactively, the regular "p4 change" command is the way to go:

p4 change

This opens the changelist spec in your editor so you can fill it out, and saves the changelist when you save the file in your editor and exit it.

If you're scripting, you can use "p4 change -i" but you need to make sure to feed it a valid changelist form via stdin. The "p4 change -o" command gives you the same form you get from "p4 change" (via stdout instead of your editor), so all that's left is to fill out the description and/or modify the list of files to be included. The --field option is useful here:

p4 --field "Description=My pending change" change -o | p4 change -i

If you want the new changelist to be empty rather than inheriting open files from the default changelist, blank the Files field:

p4 --field "Description=My pending change" --field "Files=" change -o | p4 change -i
like image 200
Samwise Avatar answered Sep 22 '22 07:09

Samwise


Just using "p4 change" will open up the change form in the editor and upon saving a numbered change is created

like image 40
Venkat Avatar answered Sep 18 '22 07:09

Venkat