23

I have shelved a changelist(say X) and I have ensured its correctness. Now i want to submit the changelist. I can

  1. p4 unshelve -s X -c Y where Y is a new changelist i create before executing this command. Then p4 shelve -c X -d and lastly p4 submit -c Y
  2. Otherwise I can unshelve X, delete the shelve X and move the local copies to changelist X(p4 reopen -c X ) and submit X.
  3. The last option is to unshelve X, delete shelve X, p4 change(and edit description) and finally p4 submit

What are your suggestions with regards to :-

  1. Use 1/3 but copy paste the description that X already had to new changelists
  2. Use 2 but copy each opened file manually in command p4 reopen.

The only advantage of 2 over 1 and 3 is that I don't have to delete X(because it turned out to be my submitted changelist, while in other cases it still is "pending").

1
  • 1
    It might be helpful, and allow more users to answer if you could give a description of what the perforce commands are doing in your three scenarios, opposed to just listing them.
    – John Kane
    Apr 8, 2013 at 11:40

5 Answers 5

57

The shortest method is:

$ p4 shelve -c #changelist -d
$ p4 submit -c #changelist
2
  • 22
    The first step gives the scary response "Shelved change 111111 deleted." Don't worry, the changelist still exists, and the files are still in it. It's just no longer "shelved". Dec 15, 2015 at 22:16
  • Thank you so much.
    – wilbeibi
    Mar 31, 2016 at 18:07
8

In the new 2013.1 release of the Perforce server, you can now do 'p4 submit -e X', which directly submits the shelf without needing to unshelve it first.

Try it, it's a great feature!

2
  • We still use 12.2. Any ideas for that?
    – user1065101
    Apr 9, 2013 at 5:56
  • 4
    I'm just going in circles.Submitting change 36629967. No files to submit. Cannot submit - files are open by client client-abc at change 36629967. May 27, 2016 at 0:35
3

From my experience with Perforce, I would just unshelve the change-list, delete the shelved files and submit. Just make sure that the description of the change-list is accurate.

3
  • So which one of 1/2/3 are you suggesting?
    – user1065101
    Apr 8, 2013 at 12:13
  • 3 sounds the closest to what I described.
    – John Kane
    Apr 8, 2013 at 12:21
  • Yours is the only answer that worked for me. Perforce makes this so confusing, in particular from the command line. May 27, 2016 at 0:39
0

With Perforce 2013.1 or later, you can submit the shelved changelist "12345" directly:

p4 submit -e 12345

On previous versions, use this combination:

p4 unshelve -s 12345
p4 submit ...
1
  • 1
    Submitting change 36629967. Change 36629967 has shelved files -- cannot submit. May 27, 2016 at 0:36
0

Since it is 2018, here is an updated answer for newer perforce versions (2013.1 and newer)

p4 submit -e 123456

This command will fail if you already have that shelvelist open in some tree like so:

Change 123456 has shelved files --  cannot submit

In that case get to the root of that tree (or use -C client_name_where_shelvelist_is_open) and revert the changes before running the above command, like so:

p4 revert -c 123456 ...
p4 submit -e 123456

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.