Reputation: 3424
I edited a file and then shelved the changes in it with shelved changelist X
. Now I edit another file. How can I add this file in already existing shelved changelist X
or generate a new changelist containing changes in both files?
Thanks.
Upvotes: 11
Views: 26455
Reputation: 30293
You don't have to unshelve
, as @Dennis suggests, although that may be one way to do it.
For an unopened file you wish to add to an existing shelf, simply open that file into your existing shelve's changelist. For example, if your shelf is identified by changelist #1729, then do
p4 edit -c 1729 forgot_to_shelve.py
Then, shelve it:
p4 shelve -c 1729
If it turns out that the file already exists in the shelf but you wish to update it, then as usual, add -f
:
p4 shelve -c 1729 -f
For a file that's currently opened that you wish to add to your existing shelf, you would first reopen
that file into your existing shelf's changelist, before shelving as above:
p4 reopen -c 1729 forgot_to_shelve_and_currently_opened.py
p4 shelve -c 1729
Reference:
In order to add a file to a pre-existing shelve, the file must first be opened in the shelve's changelist; use
p4 reopen
to move an opened file from one changelist to another.
p4 shelve // Perforce 2013.3: Command Reference
Upvotes: 18
Reputation: 20571
You can unshelve the changelist to your client, add the file, and then shelve it again. It will keep the same changelist number as changelists are only renumbered (if required to maintain chronological order) on submit.
Basically, think of a shelved changelist as a local pending changelist that you have just put aside for a moment.
Upvotes: 1